mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
2 years ago
|
import { Page } from '@playwright/test';
|
||
2 years ago
|
import BasePage from '../Base';
|
||
|
import { ProjectsPage } from '../ProjectsPage';
|
||
2 years ago
|
|
||
|
export class SignupPage extends BasePage {
|
||
2 years ago
|
readonly projectsPage: ProjectsPage;
|
||
|
|
||
2 years ago
|
constructor(rootPage: Page) {
|
||
|
super(rootPage);
|
||
2 years ago
|
this.projectsPage = new ProjectsPage(rootPage);
|
||
2 years ago
|
}
|
||
|
|
||
|
prefixEmail(email: string) {
|
||
2 years ago
|
const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0';
|
||
2 years ago
|
return `nc_test_${parallelId}_${email}`;
|
||
|
}
|
||
|
|
||
|
goto() {
|
||
2 years ago
|
return this.rootPage.goto('/#/signup/');
|
||
2 years ago
|
}
|
||
|
|
||
|
get() {
|
||
2 years ago
|
return this.rootPage.locator('html');
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async signUp({ email, password, withoutPrefix }: { email: string; password: string; withoutPrefix?: boolean }) {
|
||
|
if (!withoutPrefix) email = this.prefixEmail(email);
|
||
|
|
||
2 years ago
|
const signUp = this.rootPage;
|
||
|
await signUp.locator('button:has-text("SIGN UP")').waitFor();
|
||
|
|
||
2 years ago
|
await signUp.locator(`input[placeholder="Enter your work email"]`).fill(email);
|
||
|
await signUp.locator(`input[placeholder="Enter your password"]`).fill(password);
|
||
2 years ago
|
await signUp.locator(`button:has-text("SIGN UP")`).click();
|
||
2 years ago
|
await this.projectsPage.waitToBeRendered();
|
||
2 years ago
|
}
|
||
|
}
|