-
Notifications
You must be signed in to change notification settings - Fork 47
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
Task 4934: Refactor Slide Toggle tests #5243
Conversation
8bc5e02
to
cec3791
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflict
…gle-slide-tests # Conflicts: # jdi-light-angular/src/main/java/com/epam/jdi/light/angular/elements/common/SlideToggle.java
…gle-slide-tests # Conflicts: # jdi-light-angular-tests/src/main/java/io/github/com/pages/AngularPage.java
There was a problem hiding this 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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core().find надо вызывать
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core().hasClass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок
There was a problem hiding this 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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а как label получить? и в тестах нигде не проверяется текст
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
текст теперь проверяется
resultSlideToggle.has().correctLabelsSlideToggleText();
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кликать правильнее по кнопке, а не по полю, кто его знает, что в label засунули
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get if ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не вижу
Some tests for task 4934
Our test site requires some changes:
Add slide toggle with 'labelPosition' = before