Skip to content

Commit

Permalink
Merge pull request #1933 from rodekruis/fix.unskip-e2e-test
Browse files Browse the repository at this point in the history
Un-skip e2e test
  • Loading branch information
jannisvisser authored Jan 22, 2025
2 parents 93dd6a9 + 77b94dd commit f1ef7cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
logo of (country | async)?.countryLogos[(disasterType | async)?.disasterType];
track logo
) {
<img data-test="logo-image" src="assets/logos/{{ logo }}" />
<img data-testid="logo-image" src="assets/logos/{{ logo }}" />
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,16 @@
</div>
<div class="ion-align-items-center">
<ion-row class="ion-align-items-center">
<app-logos data-testid="user-state-country-logos"></app-logos>
<app-logos></app-logos>
<ion-item lines="none">
<ion-col
data-testid="user-state-display-name-label"
class="ion-no-padding"
>
<ion-col class="ion-no-padding">
@if (isLoggedIn) {
<ion-title size="small" class="ion-no-padding"
>Logged In As:</ion-title
>
<ion-title
size="small"
data-test="user-display-name"
data-testid="user-display-name"
class="ion-no-padding"
>
<strong
Expand Down
18 changes: 8 additions & 10 deletions tests/e2e/Pages/UserStateComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ class UserStateComponent extends DashboardPage {
super(page);
this.page = page;
this.header = this.page.getByTestId('heading-display-name-span');
this.countryLogos = this.page
.getByTestId('user-state-country-logos')
.nth(0);
this.userLoggedInLabel = this.page
.getByTestId('user-state-display-name-label')
.nth(0);
this.countryLogos = this.page.getByTestId('logo-image');
this.userLoggedInLabel = this.page.getByTestId('user-display-name');
this.logOutButton = this.page.getByTestId('user-state-logout-button');
}

Expand Down Expand Up @@ -55,11 +51,13 @@ class UserStateComponent extends DashboardPage {
firstName: string;
lastName: string;
}) {
const countryLogosCount = await this.countryLogos.count();
for (let i = 0; i < countryLogosCount; i++) {
await expect(this.countryLogos.nth(i)).toBeVisible();
}

await expect(this.dashboardHomeButton).toBeVisible();
await expect(this.countryLogos).toBeVisible(); // skip-reason: test fails often because it claims the element is hidden instead of visible
await expect(this.userLoggedInLabel).toHaveText(
`Logged In As:${firstName} ${lastName}`,
);
await expect(this.userLoggedInLabel).toHaveText(`${firstName} ${lastName}`);
await expect(this.logOutButton).toBeVisible();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export default (
components: Partial<Components>,
disasterType: string,
) => {
// Skip for now, as test often fails
test.skip(
test(
qase(3, 'User state component elements should be visible'),
{
annotation: {
Expand Down

0 comments on commit f1ef7cc

Please sign in to comment.