-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b3e916
commit f7333cf
Showing
15 changed files
with
221 additions
and
302 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
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 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
19 changes: 19 additions & 0 deletions
19
packages/suite-desktop-core/e2e/tests/suite/bridge.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,19 @@ | ||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('Bridge page', { tag: ['@group=suite', '@webOnly'] }, () => { | ||
test.beforeEach(async ({ trezorUserEnvLink }) => { | ||
await trezorUserEnvLink.stopEmu(); | ||
await trezorUserEnvLink.stopBridge(); | ||
}); | ||
|
||
test.use({ startEmulator: false }); | ||
test('can use webusb', async ({ page }) => { | ||
await page.goto('/bridge'); | ||
|
||
// user may exit bridge page and use webusb | ||
await page.getByTestId('@bridge/goto/wallet-index').click(); | ||
|
||
// connect device prompt with webusb enabled appears | ||
await expect(page.getByTestId('@connect-device-prompt')).toBeVisible(); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/suite-desktop-core/e2e/tests/suite/bug-report-form.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,20 @@ | ||
import { FeedbackCategory } from '@suite-common/suite-types'; | ||
|
||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('Bug report forms', { tag: ['@group=suite'] }, () => { | ||
test.use({ emulatorSetupConf: { mnemonic: 'mnemonic_all' } }); | ||
test('Send a bug report', async ({ page, suiteGuidePage }) => { | ||
const testData = { | ||
location: 'account' as FeedbackCategory, | ||
report: 'Henlo this is testy test writing hangry test user report', | ||
}; | ||
|
||
await suiteGuidePage.openPanel(); | ||
await suiteGuidePage.supportAndFeedbackButton.click(); | ||
|
||
await suiteGuidePage.sendBugReport(testData); | ||
|
||
await expect(page.getByTestId('@toast/user-feedback-send-success')).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,63 @@ | ||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('Guide without device', { tag: ['@group=suite', '@webOnly'] }, () => { | ||
test.beforeEach(async ({ trezorUserEnvLink }) => { | ||
await trezorUserEnvLink.stopEmu(); | ||
await trezorUserEnvLink.stopBridge(); | ||
}); | ||
test.use({ startEmulator: false }); | ||
test('open / close guide', async ({ page, suiteGuidePage, settingsPage }) => { | ||
// Open guide | ||
await suiteGuidePage.openPanel(); | ||
const firstNode = suiteGuidePage.guideNodes.first().locator('> *').first(); | ||
const text = await firstNode.innerText(); | ||
await firstNode.click(); | ||
await expect(suiteGuidePage.guideLabel).toHaveText(text); | ||
await firstNode.click(); | ||
await suiteGuidePage.closeGuide(); | ||
await expect(suiteGuidePage.guideButton).toBeVisible(); | ||
|
||
// Feedback form | ||
await suiteGuidePage.openPanel(); | ||
await suiteGuidePage.supportAndFeedbackButton.click(); | ||
await suiteGuidePage.feedbackFormButton.click(); | ||
await page.getByTestId('@guide/feedback/suggestion/5').click(); | ||
await suiteGuidePage.bugInputTextField.fill('Hello!'); | ||
await suiteGuidePage.submitButton.click(); | ||
await expect(suiteGuidePage.feedbackSuccessToast).toBeVisible(); | ||
|
||
// Guide over modal | ||
await settingsPage.navigateTo('application'); | ||
await settingsPage.showLogButton.click(); | ||
await suiteGuidePage.closeGuide(); | ||
await suiteGuidePage.openPanel(); | ||
await expect(suiteGuidePage.guidePanel).toBeVisible(); | ||
|
||
// Search input | ||
await suiteGuidePage.searchInput.fill('trezor'); | ||
await expect | ||
.poll(async () => (await suiteGuidePage.searchResults.all()).length) | ||
.toBeGreaterThan(0); | ||
await suiteGuidePage.searchInput.fill('meow-wuf-nonsense'); | ||
await expect(suiteGuidePage.searchNoResults).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('Guide with device', { tag: ['@group=suite'] }, () => { | ||
test('onboarding with device', async ({ | ||
page, | ||
analyticsPage, | ||
onboardingPage, | ||
suiteGuidePage, | ||
}) => { | ||
await onboardingPage.disableFirmwareHashCheck(); | ||
await onboardingPage.optionallyDismissFwHashCheckError(); | ||
await analyticsPage.continueButton.click(); | ||
|
||
await suiteGuidePage.openPanel(); | ||
await expect(page.getByTestId('@guide/panel')).toBeVisible(); | ||
await page.getByTestId('@guide/button-feedback').click(); | ||
await expect(suiteGuidePage.bugFormButton).toBeVisible(); | ||
await expect(suiteGuidePage.feedbackFormButton).toBeVisible(); | ||
}); | ||
}); |
33 changes: 33 additions & 0 deletions
33
packages/suite-desktop-core/e2e/tests/suite/initial-run.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,33 @@ | ||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('Suite initial run', { tag: ['@group=suite'] }, () => { | ||
test.beforeEach(async ({ onboardingPage }) => { | ||
await onboardingPage.disableFirmwareHashCheck(); | ||
}); | ||
|
||
test('Until user passed through initial run, it will be there after reload', async ({ | ||
page, | ||
analyticsPage, | ||
onboardingPage, | ||
}) => { | ||
await expect(analyticsPage.toggleSwitch).toBeVisible(); | ||
await page.reload(); | ||
// analytics screen is there until user confirms his choice | ||
await expect(analyticsPage.toggleSwitch).toBeVisible(); | ||
await analyticsPage.continueButton.click(); | ||
await page.reload(); | ||
await expect(analyticsPage.toggleSwitch).not.toBeVisible(); | ||
await expect(onboardingPage.onboardingContinueButton).toBeVisible(); | ||
}); | ||
|
||
test('Once user passed trough, skips initial run and shows connect-device modal', async ({ | ||
page, | ||
dashboardPage, | ||
onboardingPage, | ||
}) => { | ||
await onboardingPage.completeOnboarding({ enableViewOnly: true }); | ||
await dashboardPage.discoveryShouldFinish(); | ||
await page.reload(); | ||
await expect(dashboardPage.deviceSwitchingOpenButton).toContainText('Connected'); | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
packages/suite-desktop-core/e2e/tests/suite/safety-checks-warning.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,48 @@ | ||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('safety_checks Warnings', { tag: ['@group=suite'] }, () => { | ||
test.beforeEach(async ({ onboardingPage, dashboardPage, settingsPage }) => { | ||
await onboardingPage.completeOnboarding(); | ||
await dashboardPage.discoveryShouldFinish(); | ||
await settingsPage.changeSafetyChecksLevel('prompt'); | ||
}); | ||
|
||
test('Dismissible warning appears when safety_checks to prompt', async ({ page }) => { | ||
await expect(page.getByTestId('@banner/safety-checks/button')).toBeVisible(); | ||
await expect(page.getByTestId('@banner/safety-checks/dismiss')).toBeVisible(); | ||
}); | ||
|
||
test('CTA button opens device settings when safety_checks to prompt', async ({ page }) => { | ||
await page.getByTestId('@banner/safety-checks/button').click(); | ||
// In CI the path is prefixed with a branch name. Test only against the end of the path. | ||
await expect(page).toHaveURL(/\/settings\/device$/); | ||
}); | ||
|
||
test('Dismiss button hides the warning when safety_checks to prompt', async ({ page }) => { | ||
await page.getByTestId('@banner/safety-checks/dismiss').click(); | ||
await expect(page.getByTestId('@banner/safety-checks/button')).not.toBeVisible(); | ||
}); | ||
|
||
test('Warning disappears when safety_checks are set to strict from prompt', async ({ | ||
page, | ||
settingsPage, | ||
}) => { | ||
await settingsPage.changeSafetyChecksLevel('strict'); | ||
|
||
await expect(page.getByTestId('@banner/safety-checks/button')).not.toBeVisible(); | ||
}); | ||
|
||
test('Dismissed warning re-appears when safety_checks are set to strict and then to Prompt again', async ({ | ||
page, | ||
settingsPage, | ||
}) => { | ||
await settingsPage.changeSafetyChecksLevel('strict'); | ||
|
||
await expect(page.getByTestId('@banner/safety-checks/button')).not.toBeVisible(); | ||
// Set safety_checks back to PromptTemporarily | ||
await settingsPage.changeSafetyChecksLevel('prompt'); | ||
|
||
// Assert the warning appears again. | ||
await expect(page.getByTestId('@banner/safety-checks/button')).toBeVisible(); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
packages/suite-desktop-core/e2e/tests/suite/version-page.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,18 @@ | ||
import { getSuiteVersion } from '@trezor/env-utils'; | ||
|
||
import { expect, test } from '../../support/fixtures'; | ||
|
||
test.describe('Hidden version page', { tag: ['@group=suite', '@webOnly'] }, () => { | ||
test.beforeEach(async ({ trezorUserEnvLink }) => { | ||
await trezorUserEnvLink.stopEmu(); | ||
await trezorUserEnvLink.stopBridge(); | ||
}); | ||
test.use({ startEmulator: false }); | ||
|
||
test('is accessible via route', async ({ page }) => { | ||
const suiteVersion = getSuiteVersion(); | ||
await page.goto('/version'); | ||
await expect(page.getByTestId('@version/number')).toContainText(suiteVersion); | ||
await page.getByTestId('@modal/version').screenshot({ path: 'version-modal.png' }); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
packages/suite-web/e2e/tests/suite/bug-report-form.test.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.