-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/suite core/e2e/convert unsupported browsers (#16171)
* feat(e2e): Convert to pw browser tests Unfortunatelly, PW does not support Firefox + Mobile combination It is also not recommended to run automation on outdated browsers * fix(e2e): Fix the web visual regresion checks and add it for browser tests * fix(e2e): add missing browser install on CI adds also firefox desktop test * refactor(e2e): switch ios to more stable Aria snapshot verification also mask larger element for asset visual regression verification * fix(e2e): Change Safari tests to use Aria comparison too
- Loading branch information
Showing
10 changed files
with
79 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/suite-desktop-core/e2e/tests/browser/firefox.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test, expect } from '../../support/fixtures'; | ||
|
||
test.use({ startEmulator: false, browserName: 'firefox' }); | ||
test.describe('Firefox', { tag: ['@group=other', '@webOnly'] }, () => { | ||
test('Suite does support Firefox', async ({ page }) => { | ||
await expect(page.getByTestId('@welcome/title')).toBeVisible(); | ||
await expect(page.getByText('Continue at my own risk')).not.toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { devices } from '@playwright/test'; | ||
|
||
import { test, expect } from '../../support/fixtures'; | ||
|
||
const iosAria = ` | ||
- heading "Suite doesn’t work on iOS yet" [level=1] | ||
- paragraph: "We’re working hard to bring the Trezor Suite mobile web app to iOS. In the meantime, you can use Trezor Suite on the following platforms:" | ||
- list: | ||
- listitem: Trezor Suite desktop app | ||
- listitem: Trezor Suite for web | ||
- listitem: Mobile web app for Chrome on Android | ||
`; | ||
|
||
test.use({ startEmulator: false, browserName: 'chromium', ...devices['iPhone 15 Pro'] }); | ||
test.describe('iPhone with Chrome browser', { tag: ['@group=other', '@webOnly'] }, () => { | ||
test('Suite does not support iOS', async ({ page }) => { | ||
await expect( | ||
page.getByRole('heading', { name: 'Suite doesn’t work on iOS yet' }), | ||
).toBeVisible(); | ||
await expect(page.locator('body')).toMatchAriaSnapshot(iosAria); | ||
await expect(page.getByText('Continue at my own risk')).not.toBeVisible(); | ||
}); | ||
}); |
24 changes: 24 additions & 0 deletions
24
packages/suite-desktop-core/e2e/tests/browser/safari.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { test, expect } from '../../support/fixtures'; | ||
|
||
const safariAria = ` | ||
- heading "Your browser is not supported" [level=1] | ||
- paragraph: We recommend using the Trezor Suite desktop app for the best experience. Alternatively, download a supported browser to use the Trezor Suite web app. | ||
- link "Desktop App Download": | ||
- img | ||
- paragraph: Desktop App | ||
- link /Chrome \\d+\\+ Download/: | ||
- img | ||
- paragraph: /Chrome \\d+\\+/ | ||
- paragraph: Using outdated or unsupported browsers can expose you to security risks. To keep your funds safe, we recommend using the latest version of a supported browser. | ||
- paragraph: Continue at my own risk | ||
`; | ||
|
||
test.use({ startEmulator: false, browserName: 'webkit' }); | ||
test.describe('Safari', { tag: ['@group=other', '@webOnly'] }, () => { | ||
test('Suite does not support Safari', async ({ page }) => { | ||
await expect(page.locator('body')).toMatchAriaSnapshot(safariAria); | ||
await expect(page.getByTestId('@continue-to-suite')).toHaveText('Continue at my own risk'); | ||
await page.getByTestId('@continue-to-suite').click(); | ||
await expect(page.getByTestId('@welcome/title')).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
packages/suite-web/e2e/tests/browser/outdated-chrome.test.ts
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
packages/suite-web/e2e/tests/browser/outdated-firefox.test.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.