mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 17:14:17 +08:00
added cypress framework and tests for setup page
This commit is contained in:
8
cypress/support/actors/actor.ts
Normal file
8
cypress/support/actors/actor.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { SetupTask } from "../tasks/setup-task";
|
||||
|
||||
class Actor {
|
||||
setupTask: SetupTask = new SetupTask();
|
||||
}
|
||||
|
||||
const actor = new Actor();
|
||||
export { actor };
|
0
cypress/support/commands.ts
Normal file
0
cypress/support/commands.ts
Normal file
4
cypress/support/const/user-data.ts
Normal file
4
cypress/support/const/user-data.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const DEFAULT_USER_DATA = {
|
||||
username: "testuser",
|
||||
password: "testuser123",
|
||||
};
|
1
cypress/support/e2e.ts
Normal file
1
cypress/support/e2e.ts
Normal file
@@ -0,0 +1 @@
|
||||
import "./commands";
|
3
cypress/support/pages/dasboard-page.ts
Normal file
3
cypress/support/pages/dasboard-page.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const DashboardPage = {
|
||||
url: Cypress.env("baseUrl") + "/dashboard",
|
||||
};
|
7
cypress/support/pages/setup-page.ts
Normal file
7
cypress/support/pages/setup-page.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const SetupPage = {
|
||||
url: Cypress.env("baseUrl") + "/setup",
|
||||
usernameInput: '[data-cy="username-input"]',
|
||||
passWordInput: '[data-cy="password-input"]',
|
||||
passwordRepeatInput: '[data-cy="password-repeat-input"]',
|
||||
submitSetupForm: '[data-cy="submit-setup-form"]',
|
||||
};
|
15
cypress/support/tasks/setup-task.ts
Normal file
15
cypress/support/tasks/setup-task.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { SetupPage } from "../pages/setup-page";
|
||||
|
||||
export class SetupTask {
|
||||
fillAndSubmitSetupForm(
|
||||
username: string,
|
||||
password: string,
|
||||
passwordRepeat: string
|
||||
) {
|
||||
cy.get(SetupPage.usernameInput).type(username);
|
||||
cy.get(SetupPage.passWordInput).type(password);
|
||||
cy.get(SetupPage.passwordRepeatInput).type(passwordRepeat);
|
||||
|
||||
cy.get(SetupPage.submitSetupForm).click();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user