-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add new initial screen E2E tests (#2626)
Co-authored-by: Denis Nebytov <denis@emurgo.io>
- Loading branch information
Showing
8 changed files
with
141 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {by, element} from 'detox' | ||
|
||
export const dropDownLanguagePicker = () => element(by.id('dropDownLanguagePicker')) | ||
export const checkboxSelect = () => element(by.id('checkboxSelect')) | ||
export const linkToS = () => element(by.id('linkToS')) | ||
export const linkPrivacyPolicy = () => element(by.id('linkPrivacyPolicy')) | ||
export const buttonContinue = () => element(by.id('buttonContinue')) | ||
export const buttonSelectLanguageEnglish = () => element(by.id('languageSelect_en-US')) | ||
export const buttonSelectLanguageItalian = () => element(by.id('languageSelect_it-IT')) | ||
export const buttonBack = () => element(by.id('buttonBack')) | ||
export const buttonBack2 = () => element(by.id('buttonBack2')) |
53 changes: 53 additions & 0 deletions
53
apps/wallet-mobile/e2e/tests/_android/general-checks.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,53 @@ | ||
import {device, expect} from 'detox' | ||
|
||
import * as initialScreen from '../../screens/initialScreen.screen' | ||
import * as analyticsScreen from '../../screens/shareUserInsights.screen' | ||
import * as utils from '../../utils' | ||
|
||
describe('General checks', () => { | ||
beforeAll(async () => { | ||
await device.launchApp({newInstance: true}) | ||
}) | ||
|
||
it('should be able to check if initial screen is loaded', async () => { | ||
await expect(element(by.text('Select language'))).toBeVisible() | ||
}) | ||
|
||
it('should be able to select/reselect a language of choice', async () => { | ||
await expect(initialScreen.dropDownLanguagePicker()).toBeVisible() | ||
await initialScreen.dropDownLanguagePicker().tap() | ||
await initialScreen.buttonSelectLanguageItalian().tap() | ||
await initialScreen.buttonSelectLanguageEnglish().tap() | ||
|
||
await initialScreen.buttonBack().tap() | ||
}) | ||
|
||
it('should be able to verify the Privacy Policy link', async () => { | ||
await expect(initialScreen.linkPrivacyPolicy()).toBeVisible() | ||
await initialScreen.linkPrivacyPolicy().tap() | ||
await expect(element(by.text('3. Collection of Personal Data'))).toBeVisible() | ||
await utils.takeScreenshot('Privacy Policy is displayed') | ||
await initialScreen.buttonBack2().tap() | ||
}) | ||
|
||
it('should be able to verify the ToS link', async () => { | ||
await expect(initialScreen.linkToS()).toBeVisible() | ||
await initialScreen.linkToS().tap() | ||
await expect(element(by.text('1. Rights and Obligations'))).toBeVisible() | ||
await utils.takeScreenshot('Terms of Service is displayed') | ||
await initialScreen.buttonBack2().tap() | ||
}) | ||
|
||
it('should be able to select checkbox and proceed', async () => { | ||
await initialScreen.checkboxSelect().tap({x: 5, y: 10}) | ||
await initialScreen.buttonContinue().tap() | ||
await utils.takeScreenshot('User consent screen for sharing insights') | ||
}) | ||
|
||
it('should be able to skip consent for analytics and proceed', async () => { | ||
await expect(analyticsScreen.txt_PageTitle()).toBeVisible() | ||
await analyticsScreen.btn_Skip().tap() | ||
await expect(element(by.text('Enter PIN'))).toBeVisible() | ||
await utils.takeScreenshot('Enter PIN screen') | ||
}) | ||
}) |
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,53 @@ | ||
import {device, expect} from 'detox' | ||
|
||
import * as initialScreen from '../../screens/initialScreen.screen' | ||
import * as analyticsScreen from '../../screens/shareUserInsights.screen' | ||
import * as utils from '../../utils' | ||
|
||
describe('General checks', () => { | ||
beforeAll(async () => { | ||
await device.launchApp({newInstance: true}) | ||
}) | ||
|
||
it('should be able to check if initial screen is loaded', async () => { | ||
await expect(element(by.text('Select language'))).toBeVisible() | ||
}) | ||
|
||
it('should be able to select/reselect a language of choice', async () => { | ||
await expect(initialScreen.dropDownLanguagePicker()).toBeVisible() | ||
await initialScreen.dropDownLanguagePicker().tap() | ||
await initialScreen.buttonSelectLanguageItalian().tap() | ||
await initialScreen.buttonSelectLanguageEnglish().tap() | ||
|
||
await initialScreen.buttonBack().tap() | ||
}) | ||
|
||
it('should be able to verify the Privacy Policy link', async () => { | ||
await expect(initialScreen.linkPrivacyPolicy()).toBeVisible() | ||
await initialScreen.linkPrivacyPolicy().tap() | ||
await expect(element(by.text('3. Collection of Personal Data'))).toBeVisible() | ||
await utils.takeScreenshot('Privacy Policy is displayed') | ||
await initialScreen.buttonBack2().tap() | ||
}) | ||
|
||
it('should be able to verify the ToS link', async () => { | ||
await expect(initialScreen.linkToS()).toBeVisible() | ||
await initialScreen.linkToS().tap() | ||
await expect(element(by.text('1. Rights and Obligations'))).toBeVisible() | ||
await utils.takeScreenshot('Terms of Service is displayed') | ||
await initialScreen.buttonBack2().tap() | ||
}) | ||
|
||
it('should be able to select checkbox and proceed', async () => { | ||
await initialScreen.checkboxSelect().tap({x: 5, y: 10}) | ||
await initialScreen.buttonContinue().tap() | ||
await utils.takeScreenshot('User consent screen for sharing insights') | ||
}) | ||
|
||
it('should be able to skip consent for analytics and proceed', async () => { | ||
await expect(analyticsScreen.txt_PageTitle()).toBeVisible() | ||
await analyticsScreen.btn_Skip().tap() | ||
await expect(element(by.text('Enter PIN'))).toBeVisible() | ||
await utils.takeScreenshot('Enter PIN screen') | ||
}) | ||
}) |
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
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