Skip to content

Commit

Permalink
Fix Codacy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pnatashap committed Feb 16, 2023
1 parent 46381f3 commit 23bd461
Show file tree
Hide file tree
Showing 39 changed files with 45 additions and 97 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.com.custom;

import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import com.epam.jdi.light.vuetify.elements.complex.Calendar;
import com.epam.jdi.light.vuetify.elements.complex.Card;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
import com.epam.jdi.light.ui.html.elements.common.Text;
import com.epam.jdi.light.vuetify.elements.common.ProgressLinear;
import com.epam.jdi.light.vuetify.elements.complex.Card;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.complex.WebList;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
import com.epam.jdi.light.vuetify.elements.complex.Card;
import org.openqa.selenium.Keys;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.com.custom.tables;

import com.epam.jdi.light.elements.complex.dropdown.Dropdown;
import com.epam.jdi.light.elements.interfaces.base.ICoreElement;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.JDropdown;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package io.github.com.custom.windows;

import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.elements.interfaces.base.ICoreElement;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import com.epam.jdi.light.vuetify.elements.complex.Card;
import com.epam.jdi.light.vuetify.elements.complex.Windows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@
import static io.github.com.enums.MdiIcons.CALL_SPLIT;
import static io.github.com.enums.MdiIcons.CANCEL;
import static io.github.com.enums.MdiIcons.CHECKBOX_MARKED_CIRCLE;
import static io.github.com.enums.MdiIcons.CHEVRON_RIGHT;
import static io.github.com.enums.MdiIcons.CLOUD_UPLOAD;
import static io.github.com.enums.MdiIcons.DELETE;
import static io.github.com.enums.MdiIcons.DIALPAD;
import static io.github.com.enums.MdiIcons.DOMAIN;
import static io.github.com.enums.MdiIcons.EMAIL;
import static io.github.com.enums.MdiIcons.FOLDER_OPEN;
import static io.github.com.enums.MdiIcons.GAVEL;
import static io.github.com.enums.MdiIcons.HOME;
import static io.github.com.enums.MdiIcons.MESSAGE_TEXT;
import static io.github.com.enums.MdiIcons.MINUS_CIRCLE;
import static io.github.com.enums.MdiIcons.PENCIL;
import static io.github.com.enums.MdiIcons.SHARE_VARIANT;
import static io.github.com.enums.MdiIcons.THUMB_DOWN;
import static io.github.com.enums.MdiIcons.THUMB_UP;
import static io.github.com.enums.MdiIcons.WIDGETS;
import static io.github.com.enums.MdiIcons.WRENCH;

public class IconsDataProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package io.github.com.enums;

import com.epam.jdi.light.elements.base.UIBaseElement;
import com.epam.jdi.light.vuetify.elements.common.Icon;
import com.google.common.base.CaseFormat;
import com.opencsv.CSVReader;

import java.io.FileReader;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;

public enum MdiIcons {
ACCESS_POINT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.com.pages;

import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.vuetify.annotations.JDIRating;
import com.epam.jdi.light.vuetify.elements.complex.Card;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package io.github.com.pages;

import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.complex.WebList;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.ui.html.elements.common.Button;
import com.epam.jdi.light.vuetify.annotations.JDITreeView;
import com.epam.jdi.light.vuetify.elements.common.Input;
import com.epam.jdi.light.vuetify.elements.common.VueCheckbox;
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import com.epam.jdi.light.vuetify.elements.complex.TreeView;

public class TreeviewPage extends VuetifyPage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ public void sizeWidthProgressCircularsTests(int index, String color, int height,
.width(width)
.thickness(thickness);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.epam.vuetify.tests.complex;

import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import com.epam.jdi.light.vuetify.elements.complex.Card;
import io.github.epam.TestsInit;
import org.testng.annotations.BeforeClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ public class DatePickersTests extends TestsInit {
"5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月");
private LocalDate date = LocalDate.now();
private DateTimeFormatter dateFormatHeader = DateTimeFormatter.ofPattern("ccc, MMM d").withLocale(Locale.ENGLISH);
private DateTimeFormatter formatterYearHyphenMonth =
DateTimeFormatter.ofPattern("uuuu-MM").withLocale(Locale.ENGLISH);
private DateTimeFormatter formatterMMDDYYYY = DateTimeFormatter.ofPattern("MM/dd/uuuu").withLocale(Locale.ENGLISH);

private int currentYear = Year.now().getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
import static io.github.com.pages.SlideGroupsPage.customIconsSlideGroup;
import static io.github.com.pages.SlideGroupsPage.activeClassSlideGroup;
import static io.github.com.pages.SlideGroupsPage.pseudoCarouselCount;
import static org.testng.Assert.assertEquals;

public class SlideGroupsTests extends TestsInit {

private final int[] multipleSelectedIndexes = {1, 3};

private final String minusIcon = ".v-icon.mdi-minus";

private final String plusIcon = ".v-icon.mdi-plus";
Expand Down Expand Up @@ -55,10 +52,10 @@ public void centerActiveSlideGroupTests() {
centerActiveSlideGroup.slideByIndex(i).click();
centerActiveSlideGroup.has().slideSelected(i);
}
for (Integer slidesPosition : slidesPositions) {
centerActiveSlideGroup.slideByIndex(4).click();
centerActiveSlideGroup.has().slideSelected(3);
}

centerActiveSlideGroup.slideByIndex(4).click();
centerActiveSlideGroup.has().slideSelected(3);

for (int i = 4; i <= 6; i++) {
centerActiveSlideGroup.slideByIndex(i).click();
centerActiveSlideGroup.has().slideSelected(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import io.github.epam.TestsInit;
import io.github.epam.vuetify.tests.data.TabsTestsDataProvider;
import org.hamcrest.Matchers;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert;
import static com.epam.jdi.light.elements.common.WindowsManager.resizeWindow;
import static com.jdiai.tools.Timer.waitCondition;
import static io.github.com.StaticSite.tabsPage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.epam.jdi.light.asserts.generic.UIAssert;
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.common.AspectRatios;
import com.jdiai.tools.Timer;
import org.hamcrest.Matchers;

import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
import com.epam.jdi.light.asserts.generic.UIAssert;
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.composite.Footer;
import com.epam.jdi.light.vuetify.interfaces.asserts.*;
import com.epam.jdi.light.vuetify.interfaces.asserts.ColorAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ElevationAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.OutlinedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.RoundedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ShapedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.TileAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ContainerAssert;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.epam.jdi.light.asserts.generic.UIAssert;
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.common.ListItem;
import com.jdiai.tools.Timer;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;

Expand All @@ -15,15 +14,6 @@
*/
public class ListItemAssert extends UIAssert<ListItemAssert, ListItem> implements ITextAssert<ListItemAssert> {

private static final String IS_DISPLAYED = "is displayed";
private static final String IS_HIDDEN = "is hidden";
private static final String IS_ACTIVE = "is active";
private static final String IS_NOT_ACTIVE = "is not active";
private static final String IS_CLICKABLE = "is clickable";
private static final String IS_NOT_CLICKABLE = "is not clickable";
private static final String IS_EXPANDED = "is expanded";
private static final String IS_COLLAPSED = "is collapsed";

@Override
@JDIAction("Assert that '{name}' is displayed")
public ListItemAssert displayed() {
Expand Down Expand Up @@ -104,7 +94,7 @@ public ListItemAssert expanded() {

/**
* Checks that the list item is collapsed.
*;
*
* @return this {@link ListItemAssert} instance
*/
@JDIAction("Assert that '{name}' is collapsed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.complex.Pagination;
import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ColorAssert;

import org.hamcrest.Matchers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
import com.epam.jdi.light.asserts.generic.UIAssert;
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.common.Sheet;
import com.epam.jdi.light.vuetify.interfaces.asserts.*;
import com.epam.jdi.light.vuetify.interfaces.asserts.ColorAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.OutlinedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.TileAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ShapedAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.ElevationAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.MeasurementAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.RoundedAssert;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.vuetify.elements.complex.SlideGroup;
import com.epam.jdi.light.vuetify.interfaces.asserts.ThemeAssert;
import com.jdiai.tools.Timer;
import org.hamcrest.Matchers;

import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import com.epam.jdi.light.vuetify.interfaces.asserts.DenseAssert;
import com.epam.jdi.light.vuetify.interfaces.asserts.LoadingAssert;
import org.hamcrest.Matchers;
import java.util.List;
import java.util.Map;
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert;
import static org.hamcrest.Matchers.equalTo;

public class TreeViewAssert extends UISelectAssert<TreeViewAssert, TreeView> implements
LoadingAssert<TreeViewAssert, TreeView>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import java.util.List;
import java.util.Map;
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert;
import static com.jdiai.tools.Timer.waitCondition;
import static java.util.Arrays.asList;
Expand Down Expand Up @@ -106,7 +105,6 @@ public TreeViewNodeAssert notMarked() {

@JDIAction("Assert that '{0}' values checked in '{name}'")
public TreeViewNodeAssert checked(Matcher<? super List<String>> values) {
List<String> actualCheckedValues = element().checked();
jdiAssert(element().checked(), values);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public VuetifyListGroupAssert expanded() {

/**
* Checks that the list item is collapsed.
*;
*
* @return this {@link VuetifyListGroupAssert} instance
*/
@JDIAction("Assert that '{name}' is collapsed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
* To see an example of Alert web element please visit https://vuetifyjs.com/en/components/alerts/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.epam.jdi.light.elements.common.Label;
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.interfaces.base.HasLabel;
import com.epam.jdi.light.ui.html.elements.common.Checkbox;
import com.epam.jdi.light.vuetify.asserts.VueCheckboxAssert;
import com.epam.jdi.light.vuetify.interfaces.HasColor;
import com.epam.jdi.light.vuetify.interfaces.HasMessages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

/**
* To see an example of Button Group web element please visit https://vuetifyjs.com/en/components/button-groups/
* <p>
* Created by Nikita Nechepurenko on 01.10.2021
* <p>
* This element describes <b>a container</b> with buttons in it.
* You can specify a locator for inner buttons with the JDIButtonGroup annotation.
Expand All @@ -40,12 +39,6 @@
public class ButtonGroup extends UIListBase<UISelectAssert<ButtonGroupAssert, ButtonGroup>>
implements ISetup, HasClick, HasIcon, HasColor, HasTheme, HasRounded, IsShaped, HasMeasurement, IsDense, IsTile {

@Override
@JDIAction("Is item '{0}' selected in {name}")
public boolean selected(int index) {
return get(index).hasClass("v-item--active");
}

private String buttonsLocator = ".v-btn";

public ButtonGroup() {
Expand All @@ -55,6 +48,12 @@ public ButtonGroup(UIElement element) {
core().setCore(element);
}

@Override
@JDIAction("Is item '{0}' selected in {name}")
public boolean selected(int index) {
return get(index).hasClass("v-item--active");
}

@JDIAction("Get Button with index '{0}'")
public VuetifyButton getButtonByIndex(int index) {
return castToButton(list().get(index));
Expand Down Expand Up @@ -131,4 +130,4 @@ public ButtonGroupAssert has() {
public UISelectAssert<?, ?> are() {
return is();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,16 @@
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.complex.WebList;

import static com.jdiai.tools.Timer.waitCondition;

import com.epam.jdi.light.vuetify.asserts.CalendarAssert;
import com.epam.jdi.light.vuetify.elements.common.VuetifyButton;
import com.epam.jdi.light.vuetify.interfaces.HasTheme;
import org.openqa.selenium.WebElement;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static com.epam.jdi.light.elements.init.UIFactory.$;
import static com.epam.jdi.light.elements.init.UIFactory.$$;

/**
* To see an example of Calendars please visit https://vuetifyjs.com/en/components/calendars/
*/
Expand All @@ -46,8 +39,6 @@ public class Calendar extends UIBaseElement<CalendarAssert> implements HasTheme
private static final String CURRENT_TIME_LOCATOR = ".v-current-time";
private static final String SLOT_LOCATOR = ".v-sheet";

private static final DateTimeFormatter INPUT_DATE_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy");

public List<WebElement> displayedDaysOfMonth() {
return Stream.of(
finds(WEEKLY_DAY_OF_MONTH_LOCATOR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.elements.base.UIBaseElement;
import com.epam.jdi.light.elements.common.UIElement;
import com.epam.jdi.light.elements.complex.WebList;
import com.epam.jdi.light.elements.interfaces.base.HasClick;
import com.epam.jdi.light.elements.pageobjects.annotations.locators.UI;
import com.epam.jdi.light.vuetify.asserts.CardAssert;
Expand Down
Loading

0 comments on commit 23bd461

Please sign in to comment.