3613bfe1af
* 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.
69 lines
2.6 KiB
TypeScript
69 lines
2.6 KiB
TypeScript
// Copyright (C) 2023 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import {SignupPageObjects} from "@objects/SignupPageObjects";
|
|
import type {Page} from '@playwright/test';
|
|
import {expect} from "@playwright/test";
|
|
import {testConfig} from "../../testConfig";
|
|
|
|
|
|
export class SignupPage extends SignupPageObjects {
|
|
readonly page: Page;
|
|
|
|
constructor(page: Page) {
|
|
super();
|
|
this.page = page;
|
|
}
|
|
|
|
async navigateToPartnerSignup(): Promise<void> {
|
|
await this.page.goto(testConfig.host +'/signup?partner=ix-storj-1');
|
|
}
|
|
|
|
async clickOnBusinessButton(): Promise<void> {
|
|
await this.page.locator(SignupPageObjects.IX_BRANDED_BUSINESS_BUTTON_XPATH).click()
|
|
}
|
|
|
|
async signupApplicationPersonal(name: string, email: string, password: string): Promise<void> {
|
|
await this.page.locator(SignupPageObjects.INPUT_NAME_XPATH).fill(name);
|
|
await this.page.locator(SignupPageObjects.INPUT_EMAIL_XPATH).fill(email);
|
|
await this.page.locator(SignupPageObjects.INPUT_PASSWORD_XPATH).fill(password);
|
|
await this.page.locator(SignupPageObjects.INPUT_RETYPE_PASSWORD_XPATH).fill(password);
|
|
await this.clickOnEveryCheckmark();
|
|
await this.page.locator(SignupPageObjects.CREATE_ACCOUNT_BUTTON_XPATH).click();
|
|
}
|
|
|
|
async clickOnEveryCheckmark(): Promise<void> {
|
|
const checkmarks = await this.page.$$(SignupPageObjects.TOS_CHECKMARK_BUTTON_XPATH);
|
|
|
|
for (const checkmark of checkmarks) {
|
|
await checkmark.click({timeout: 8000});
|
|
}
|
|
}
|
|
|
|
async signupApplicationBusiness(name: string, email: string, password: string, company: string, position: string): Promise<void> {
|
|
await this.clickOnBusinessButton();
|
|
await this.page.locator(SignupPageObjects.COMPANY_NAME_INPUT_XPATH).fill(company);
|
|
await this.page.locator(SignupPageObjects.POSITION_INPUT_XPATH).fill(position);
|
|
await this.signupApplicationPersonal(name, email, password);
|
|
}
|
|
|
|
async verifySuccessMessage(): Promise<void> {
|
|
await expect(this.page.locator(SignupPageObjects.SIGNUP_SUCCESS_MESSAGE_XPATH)).toBeVisible();
|
|
}
|
|
|
|
async clickOnGotoLoginPage(): Promise<void> {
|
|
await this.page.locator(SignupPageObjects.GOTO_LOGIN_PAGE_BUTTON_XPATH).click();
|
|
}
|
|
|
|
|
|
async verifyIXBrandedHeader(): Promise<void> {
|
|
await expect(this.page.locator(SignupPageObjects.IX_BRANDED_HEADER_TEXT_XPATH)).toBeVisible();
|
|
}
|
|
|
|
async verifyIXBrandedSubHeader(): Promise<void> {
|
|
await expect(this.page.locator(SignupPageObjects.IX_BRANDED_SUBHEADER_TEXT_XPATH)).toBeVisible();
|
|
}
|
|
|
|
|
|
}
|