storj/testsuite/playwright-ui/pageFactory/pageRepository/DashboardPage.ts
Antonio Franco (He/Him) 3613bfe1af
testsuite/playwright: copys files to storj repo (#5648)
* testsuite/playwright: copys files to storj repo
This PR copies all the playwright ui tests to the storj repository.

* CI: Jenkinsfile.ui
Jenkinsfile.ui builds all necessary items for running storj binaries, installs all items for playwright ui tests and executes the test. Note that we aren't running regular unit tests and we are not linting the code as this is occuring in the public instance. Furthermore, we still need to implement the starting of storj services as well as typescript linters for the playwright tests.

* testsuite: playwright ui tests
This PR copies all playwright ui tests files from the qa repo.

* testsuite: playwright ui tests
This PR copies all playwright ui tests files from the qa repo.
2023-03-09 11:59:45 -05:00

47 lines
1.5 KiB
TypeScript

// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.
import {DashboardPageObjects} from "@objects/DashboardPageObjects";
import type {Page} from '@playwright/test';
import {expect} from '@playwright/test';
export class DashboardPage extends DashboardPageObjects {
readonly page: Page;
constructor(page: Page) {
super();
this.page = page;
}
async verifyWelcomeMessage(): Promise<void> {
await expect(this.page.locator(DashboardPageObjects.WELCOME_TEXT_LOCATOR)).toBeVisible();
}
async clickEnterPassphraseRadioButton(): Promise<void> {
await this.page.locator(DashboardPageObjects.ENTER_PASSPHRASE_RADIO_BUTTON_XPATH).click();
}
async clickContinuePassphraseButton(): Promise<void> {
await this.page.locator(DashboardPageObjects.CONTINUE_PASSPHRASE_BUTTON_XPATH).click();
}
async enterPassphrase(passphrase: string): Promise<void> {
await this.page.locator(DashboardPageObjects.PASSPHRASE_INPUT_XPATH).fill(passphrase);
}
async clickConfirmCheckmark(): Promise<void> {
await this.page.locator(DashboardPageObjects.CHECKMARK_ENTER_PASSPHRASE_XPATH).click();
}
async enterOwnPassphraseModal(passphrase: string): Promise<void> {
await this.clickEnterPassphraseRadioButton();
await this.clickContinuePassphraseButton();
await this.enterPassphrase(passphrase);
await this.clickConfirmCheckmark();
await this.clickContinuePassphraseButton();
await this.clickContinuePassphraseButton();
}
}