Skip to content

Commit

Permalink
test(update): change order of pages in create account
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Apr 15, 2024
1 parent 0357962 commit 1a7b41d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 41 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ui-automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: Satellite-im/Uplink
ref: login_pages_rework

- name: Checkout testing directory 🔖
uses: actions/checkout@v4
Expand Down Expand Up @@ -145,6 +146,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: Satellite-im/Uplink
ref: login_pages_rework

- name: Checkout testing directory 🔖
uses: actions/checkout@v4
Expand Down
16 changes: 9 additions & 7 deletions tests/helpers/commandsNewUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import CreateOrImportScreen from "@screenobjects/account-creation/CreateOrImport
import SaveRecoverySeedScreen from "@screenobjects/account-creation/SaveRecoverySeedScreen";
import CreateUserScreen from "@screenobjects/account-creation/CreateUserScreen";
import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen";
import FriendsScreen from "@screenobjects/friends/FriendsScreen";
import { saveUserRecoverySeed } from "./commands";

// Login or Create Users Functions
Expand All @@ -16,24 +15,27 @@ export async function createNewUser(

// Enter pin for test user
await CreatePinScreen.enterPinOnCreateAccount("1234");
await CreatePinScreen.createAccountButton.waitForEnabled();
await CreatePinScreen.waitUntilCreateAccountButtonIsEnabled();
await CreatePinScreen.clickOnCreateAccount();

// Bypass new Recovery Seed Screens
await CreateOrImportScreen.waitForIsShown(true);
await CreateOrImportScreen.clickOnCreateAccount();

// Enter Username and click on Create Account
await CreateUserScreen.waitForIsShown(true);
await CreateUserScreen.enterUsername(username);
await CreateUserScreen.waitUntilCreateAccountButtonIsEnabled();
await CreateUserScreen.clickOnCreateAccount();

// Save Recovery Seed Words
await SaveRecoverySeedScreen.waitForIsShown(true);
if (saveSeedWords === true) {
const recoverySeed = await SaveRecoverySeedScreen.getSeedWords();
await saveUserRecoverySeed(username, recoverySeed);
}
await SaveRecoverySeedScreen.clickOnISavedItButton();

// Enter Username and click on Create Account
await CreateUserScreen.enterUsername(username);
await CreateUserScreen.createAccountButton.waitForEnabled();
await CreateUserScreen.clickOnCreateAccount();

// Ensure Main Screen is displayed
await WelcomeScreen.welcomeLayout.waitForExist({ timeout: 60000 });
}
74 changes: 40 additions & 34 deletions tests/specs/01-create-account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,41 +129,8 @@ export default async function createAccountTests() {
await CreateOrImportScreen.clickOnCreateAccount();
});

it("Save Recovery Seed Screen - Contents validation", async () => {
// Validate contents of Save Recovery Seed Screen
await SaveRecoverySeedScreen.waitForIsShown(true);
const helperText = await SaveRecoverySeedScreen.copySeedHelperText;
const copySeedTitle = await SaveRecoverySeedScreen.copySeedWordsLabelText;
await expect(helperText).toHaveText(
"Write these words down in the order that they appear. Having the correct order is crucial when you are recovering your account.",
);
await expect(copySeedTitle).toHaveText("RECOVERY SEED");

// Validate 12 recovery seed words are displayed on screen
const seedWords = await SaveRecoverySeedScreen.getSeedWords();
await expect(seedWords.length).toEqual(12);
});

it("Save Recovery Seed Screen - User can go back to previous screen", async () => {
// Go Back to Create or Import Account screen
await SaveRecoverySeedScreen.clickOnGoBackButton();
await CreateOrImportScreen.waitForIsShown(true);

// Return to Save Recovery Seed Screen
await CreateOrImportScreen.clickOnCreateAccount();
});

it("Save Recovery Seed Screen - User can click Copy to Clipboard and then on I Saved It to continue", async () => {
// Click on I Saved It Button to continue to Enter Username Screen
await SaveRecoverySeedScreen.waitForIsShown(true);
await SaveRecoverySeedScreen.clickOnCopySeedButton();
const recoverySeed = await SaveRecoverySeedScreen.getSeedWords();
await saveUserRecoverySeed("Test123", recoverySeed);
await SaveRecoverySeedScreen.clickOnISavedItButton();
await CreateUserScreen.waitForIsShown(true);
});

it("Enter Username Screen - Cannot continue with empty value", async () => {
await CreateUserScreen.waitForIsShown(true);
const helperText = await CreateUserScreen.createUserHelperText;
const headerText = await CreateUserScreen.createUserLabelText;
await expect(helperText).toHaveText(
Expand Down Expand Up @@ -241,6 +208,45 @@ export default async function createAccountTests() {
await CreateUserScreen.getStatusOfCreateAccountButton();
await expect(statusOfButton).toEqual("true");
await CreateUserScreen.clickOnCreateAccount();
});

it("Save Recovery Seed Screen - Contents validation", async () => {
// Validate contents of Save Recovery Seed Screen
await SaveRecoverySeedScreen.waitForIsShown(true);
const helperText = await SaveRecoverySeedScreen.copySeedHelperText;
const copySeedTitle = await SaveRecoverySeedScreen.copySeedWordsLabelText;
await expect(helperText).toHaveText(
"Write these words down in the order that they appear. Having the correct order is crucial when you are recovering your account.",
);
await expect(copySeedTitle).toHaveText("RECOVERY SEED");

// Validate 12 recovery seed words are displayed on screen
const seedWords = await SaveRecoverySeedScreen.getSeedWords();
await expect(seedWords.length).toEqual(12);
});

it("Save Recovery Seed Screen - User can go back to previous screen", async () => {
// Go Back to Create or Import Account screen
await SaveRecoverySeedScreen.clickOnGoBackButton();
await CreateOrImportScreen.waitForIsShown(true);

// Return to Save Recovery Seed Screen
await CreateOrImportScreen.clickOnCreateAccount();

// Enter username again
await CreateUserScreen.enterUsername("Test123");
await CreateUserScreen.waitUntilCreateAccountButtonIsEnabled();
await CreateUserScreen.clickOnCreateAccount();
});

it("Save Recovery Seed Screen - User can click Copy to Clipboard and then on I Saved It to continue", async () => {
// Click on I Saved It Button to continue to Enter Username Screen
await SaveRecoverySeedScreen.waitForIsShown(true);
await SaveRecoverySeedScreen.clickOnCopySeedButton();
const recoverySeed = await SaveRecoverySeedScreen.getSeedWords();
await saveUserRecoverySeed("Test123", recoverySeed);
await SaveRecoverySeedScreen.clickOnISavedItButton();

await WelcomeScreen.welcomeLayout.waitForExist({ timeout: 60000 });

// If current driver is Windows, then maximize screen
Expand Down

0 comments on commit 1a7b41d

Please sign in to comment.