MOBILE-3947 behat: Fix ion-toggle press
This commit is contained in:
parent
1f667da246
commit
90a47b2441
@ -346,7 +346,6 @@ Feature: Test basic usage of messages in app
|
|||||||
Then I should find "test message" in the app
|
Then I should find "test message" in the app
|
||||||
And I should find "Muted conversation" in the app
|
And I should find "Muted conversation" in the app
|
||||||
|
|
||||||
@ionic7_failure
|
|
||||||
Scenario: Self conversations
|
Scenario: Self conversations
|
||||||
Given I entered the app as "student1"
|
Given I entered the app as "student1"
|
||||||
When I press "Messages" in the app
|
When I press "Messages" in the app
|
||||||
|
@ -7,17 +7,22 @@
|
|||||||
[href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden"
|
[href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden"
|
||||||
[detail]="!!(item.href && !item.iconAction)" role="menuitem" [button]="!!(item.href && !item.iconAction)"
|
[detail]="!!(item.href && !item.iconAction)" role="menuitem" [button]="!!(item.href && !item.iconAction)"
|
||||||
[showBrowserWarning]="item.showBrowserWarning">
|
[showBrowserWarning]="item.showBrowserWarning">
|
||||||
|
<ion-toggle *ngIf="item.iconAction === 'toggle'" [(ngModel)]="item.toggle" (ionChange)="item.toggleChanged($event)">
|
||||||
|
<p class="item-heading">
|
||||||
|
<core-format-text [clean]="true" [text]="item.content" [filter]="false" />
|
||||||
|
</p>
|
||||||
|
</ion-toggle>
|
||||||
|
<ng-container *ngIf="item.iconAction !== 'toggle'">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">
|
<p class="item-heading">
|
||||||
<core-format-text [clean]="true" [text]="item.content" [filter]="false" />
|
<core-format-text [clean]="true" [text]="item.content" [filter]="false" />
|
||||||
</p>
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ng-container *ngIf="(item.href || item.action) && item.iconAction">
|
<ng-container *ngIf="(item.href || item.action) && item.iconAction">
|
||||||
<ion-icon *ngIf="item.iconAction !== 'spinner' && item.iconAction !== 'toggle'" [name]="item.iconAction"
|
<ion-icon *ngIf="item.iconAction !== 'spinner'" [name]="item.iconAction" [class.icon-slash]="item.iconSlash" slot="end"
|
||||||
[class.icon-slash]="item.iconSlash" slot="end" aria-hidden="true" />
|
aria-hidden="true" />
|
||||||
<ion-spinner *ngIf="item.iconAction === 'spinner'" slot="end" [attr.aria-label]="'core.loading' | translate" />
|
<ion-spinner *ngIf="item.iconAction === 'spinner'" slot="end" [attr.aria-label]="'core.loading' | translate" />
|
||||||
<ion-toggle *ngIf="item.iconAction === 'toggle'" [(ngModel)]="item.toggle" (ionChange)="item.toggleChanged($event)"
|
</ng-container>
|
||||||
slot="end" />
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ion-badge class="{{item.badgeClass}}" slot="end" *ngIf="item.badge">
|
<ion-badge class="{{item.badgeClass}}" slot="end" *ngIf="item.badge">
|
||||||
<span [attr.ara-hidden]="!!item.badgeA11yText">{{item.badge}}</span>
|
<span [attr.ara-hidden]="!!item.badgeA11yText">{{item.badge}}</span>
|
||||||
|
@ -612,8 +612,10 @@ export class TestingBehatDomUtilsService {
|
|||||||
// may not work without doing this.
|
// may not work without doing this.
|
||||||
const parentElement = this.getParentElement(element);
|
const parentElement = this.getParentElement(element);
|
||||||
|
|
||||||
if (parentElement && parentElement.matches('ion-button, ion-back-button')) {
|
if (parentElement?.matches('ion-button, ion-back-button')) {
|
||||||
element = parentElement;
|
element = parentElement;
|
||||||
|
} else if (parentElement?.tagName === 'ION-ITEM' && parentElement?.classList.contains('clickable')) {
|
||||||
|
element = parentElement.querySelector<HTMLElement>('ion-toggle') || element;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rect = await this.ensureElementVisible(element);
|
const rect = await this.ensureElementVisible(element);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user