Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 4934: Refactor Slide Toggle tests #5243

Merged

Conversation

ilya1032
Copy link
Contributor

@ilya1032 ilya1032 commented Dec 1, 2023

Some tests for task 4934

Our test site requires some changes:

Add slide toggle with 'labelPosition' = before

@ilya1032 ilya1032 linked an issue Dec 1, 2023 that may be closed by this pull request
4 tasks
@MayaElf MayaElf changed the title Task 4934: Refactor Slide Toggle tests [WIP]Task 4934: Refactor Slide Toggle tests Dec 1, 2023
@MayaElf MayaElf force-pushed the task-4934-refactor-toggle-slide-tests branch from 8bc5e02 to cec3791 Compare December 15, 2023 11:09
@MayaElf MayaElf marked this pull request as ready for review December 18, 2023 08:46
@MayaElf MayaElf changed the title [WIP]Task 4934: Refactor Slide Toggle tests Task 4934: Refactor Slide Toggle tests Dec 18, 2023
@MayaElf MayaElf requested review from pnatashap and vklonin December 18, 2023 08:46
Copy link
Contributor

@pnatashap pnatashap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge conflict

@igor-vlasiuk igor-vlasiuk assigned igor-vlasiuk and unassigned MayaElf Dec 20, 2023
Igor Vlasiuk added 3 commits December 20, 2023 13:11
…gle-slide-tests

# Conflicts:
#	jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java
Igor Vlasiuk added 3 commits December 21, 2023 13:08
…gle-slide-tests

# Conflicts:
#	jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java
@vklonin vklonin merged commit 5c9f68b into angular_rework_development Dec 21, 2023
4 checks passed
@vklonin vklonin deleted the task-4934-refactor-toggle-slide-tests branch December 21, 2023 12:11
Copy link
Contributor

@pnatashap pnatashap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed

}

@Override
public boolean isDisabled() {
return !isEnabled();
UIElement e = find("//button");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core().find надо вызывать

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок

public boolean isSelected() {
return super.isSelected() || hasClass("mat-checked") || hasClass("mat-mdc-slide-toggle-checked");
return hasClass("mat-checked") || hasClass("mat-mdc-slide-toggle-checked");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core().hasClass

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не вижу


@JDIAction("'{name}' element label is in before position")
public boolean hasLabelBeforePosition() {
return core().find(FORM_FIELD_LOCATOR).hasClass("mdc-form-field--align-end");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а как label получить? и в тестах нигде не проверяется текст

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

текст теперь проверяется
resultSlideToggle.has().correctLabelsSlideToggleText();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так проверяется выравнивание, я про сам текст, который в этом лейбле, бывают случаи, когда он динамический и мы должны иметь возможность его прочитать и проверить, что он такой, какой мы ожидаем

public void check() {
if (!isSelected()) {
click();
core().find(FORM_FIELD_LOCATOR).click();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кликать правильнее по кнопке, а не по полю, кто его знает, что в label засунули

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

изменил

return e.hasAttribute("disabled");
}

@JDIAction("'{name}' element label is in before position")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get if ....

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавил

Copy link
Contributor

@pnatashap pnatashap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не вижу изменений


@JDIAction("'{name}' element label is in before position")
public boolean hasLabelBeforePosition() {
return core().find(FORM_FIELD_LOCATOR).hasClass("mdc-form-field--align-end");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так проверяется выравнивание, я про сам текст, который в этом лейбле, бывают случаи, когда он динамический и мы должны иметь возможность его прочитать и проверить, что он такой, какой мы ожидаем

public boolean isSelected() {
return super.isSelected() || hasClass("mat-checked") || hasClass("mat-mdc-slide-toggle-checked");
return hasClass("mat-checked") || hasClass("mat-mdc-slide-toggle-checked");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не вижу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests refactoring: slide toggle element
5 participants