Skip to content

Commit

Permalink
update(ci): updates tests for removing profile
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Oct 3, 2024
1 parent d35a125 commit 5dd6558
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
2 changes: 0 additions & 2 deletions playwright/PageObjects/CreateOrImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { type Locator, type Page } from "@playwright/test";

export class CreateOrImportPage extends MainPage {
readonly buttonCreateAccount: Locator;
readonly buttonImportAccount: Locator;
readonly labelCreateTitle: Locator;
readonly textCreateDescription: Locator;

constructor(public readonly page: Page) {
super(page);
this.buttonCreateAccount = this.page.getByTestId("button-create-account");
this.buttonImportAccount = this.page.getByTestId("button-import-account");
this.labelCreateTitle = this.page.getByTestId("label-create-title");
this.textCreateDescription = this.page.getByTestId(
"text-create-description",
Expand Down
16 changes: 0 additions & 16 deletions playwright/PageObjects/LoginPin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import MainPage from "./MainPage";
import { expect, type Locator, type Page } from "@playwright/test";

export class LoginPinPage extends MainPage {
readonly buttonChangeUser: Locator;
readonly buttonClearInput: Locator;
readonly buttonCreateNewProfile: Locator;
readonly buttonPinSettings: Locator;
Expand All @@ -25,18 +24,12 @@ export class LoginPinPage extends MainPage {
readonly scrambleKeypadCheckbox: Locator;
readonly scrambleKeypadLabel: Locator;
readonly scrambleKeypadSwitch: Locator;
readonly selectProfileLabel: Locator;
readonly selectProfileUser: Locator;
readonly selectProfileUserImage: Locator;
readonly selectProfileUserName: Locator;
readonly selectProfileModal: Locator;
readonly stayUnlockedCheckbox: Locator;
readonly stayUnlockedLabel: Locator;
readonly stayUnlockedSwitch: Locator;

constructor(public readonly page: Page) {
super(page);
this.buttonChangeUser = this.page.getByTestId("button-change-user");
this.buttonClearInput = this.page.getByTestId("button-clear-input");
this.buttonCreateNewProfile = this.page.getByTestId(
"button-create-new-profile",
Expand All @@ -61,15 +54,6 @@ export class LoginPinPage extends MainPage {
this.scrambleKeypadCheckbox = this.page.locator(".slider").first();
this.scrambleKeypadLabel = this.page.getByTestId("label-scramble-keypad");
this.scrambleKeypadSwitch = this.page.getByTestId("switch-scramble-keypad");
this.selectProfileLabel = this.page.getByTestId("label-select-profile");
this.selectProfileUser = this.page.getByTestId("select-profile-user");
this.selectProfileUserImage = this.page.getByTestId(
"select-profile-user-image",
);
this.selectProfileUserName = this.page.getByTestId(
"select-profile-user-name",
);
this.selectProfileModal = this.page.getByTestId("modal-select-profile");
this.stayUnlockedCheckbox = this.page.locator(".slider").last();
this.stayUnlockedLabel = this.page.getByTestId("label-stay-unlocked");
this.stayUnlockedSwitch = this.page.getByTestId("switch-stay-unlocked");
Expand Down
33 changes: 0 additions & 33 deletions playwright/specs/01-pin-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ test.describe("Create Account and Login Tests", () => {
await expect(createOrImport.buttonCreateAccount).toHaveText(
"Create New Account",
);
await expect(createOrImport.buttonImportAccount).toHaveText(
"Import Account",
);
await createOrImport.clickCreateNewAccount();

// Validate Create New User/Status page, enter valid data and continue
Expand Down Expand Up @@ -256,36 +253,6 @@ test.describe("Create Account and Login Tests", () => {
await page.waitForURL("/chat");
});

test("A10 - User can see menu to switch to a different profile", async ({
enterPinUserContext,
}) => {
const page = enterPinUserContext.page;
const createOrImport = new CreateOrImportPage(page);
const authNewAccount = new AuthNewAccount(page);
const loginPinPage = new LoginPinPage(page);

// Click on Create New Account
await createOrImport.clickCreateNewAccount();

// Enter Username and Status
await authNewAccount.validateLoadingHeader();
await authNewAccount.typeOnUsername(username);
await authNewAccount.typeOnStatus(status);
await authNewAccount.buttonNewAccountCreate.click();

// Login Page Test
await loginPinPage.waitUntilPageIsLoaded();
await loginPinPage.buttonChangeUser.click();
await expect(loginPinPage.selectProfileModal).toBeVisible();
await expect(loginPinPage.selectProfileLabel).toHaveText("Profiles");
await expect(loginPinPage.selectProfileUserName.first()).toHaveText(
"Space Kev",
);
await expect(loginPinPage.selectProfileUserName.last()).toHaveText(
"Sara Saturn",
);
});

test("A12 - If incorrect pin is entered, error message should be displayed", async ({
enterPinUserContext,
}) => {
Expand Down

0 comments on commit 5dd6558

Please sign in to comment.