|
|
@ -2,10 +2,11 @@ |
|
|
|
import { Locator, expect } from "@playwright/test"; |
|
|
|
import { Locator, expect } from "@playwright/test"; |
|
|
|
import { DashboardPage } from ".."; |
|
|
|
import { DashboardPage } from ".."; |
|
|
|
import BasePage from "../../Base"; |
|
|
|
import BasePage from "../../Base"; |
|
|
|
|
|
|
|
import { ToolbarPage } from "../common/Toolbar"; |
|
|
|
|
|
|
|
|
|
|
|
export class FormPage extends BasePage { |
|
|
|
export class FormPage extends BasePage { |
|
|
|
readonly dashboard: DashboardPage; |
|
|
|
readonly dashboard: DashboardPage; |
|
|
|
readonly dashboardPage: DashboardPage; |
|
|
|
readonly toolbar: ToolbarPage; |
|
|
|
|
|
|
|
|
|
|
|
readonly addAllButton: Locator; |
|
|
|
readonly addAllButton: Locator; |
|
|
|
readonly removeAllButton: Locator; |
|
|
|
readonly removeAllButton: Locator; |
|
|
@ -19,35 +20,37 @@ export class FormPage extends BasePage { |
|
|
|
readonly formSubHeading: Locator; |
|
|
|
readonly formSubHeading: Locator; |
|
|
|
readonly afterSubmitMsg: Locator; |
|
|
|
readonly afterSubmitMsg: Locator; |
|
|
|
|
|
|
|
|
|
|
|
constructor(dashboardPage: DashboardPage) { |
|
|
|
constructor(dashboard: DashboardPage) { |
|
|
|
super(dashboardPage.rootPage); |
|
|
|
super(dashboard.rootPage); |
|
|
|
this.dashboard = dashboardPage; |
|
|
|
this.dashboard = dashboard; |
|
|
|
this.addAllButton = dashboardPage |
|
|
|
this.toolbar = new ToolbarPage(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.addAllButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-add-all"]'); |
|
|
|
.locator('[data-pw="nc-form-add-all"]'); |
|
|
|
this.removeAllButton = dashboardPage |
|
|
|
this.removeAllButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-remove-all"]'); |
|
|
|
.locator('[data-pw="nc-form-remove-all"]'); |
|
|
|
this.submitButton = dashboardPage |
|
|
|
this.submitButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-submit"]'); |
|
|
|
.locator('[data-pw="nc-form-submit"]'); |
|
|
|
|
|
|
|
|
|
|
|
this.showAnotherFormRadioButton = dashboardPage |
|
|
|
this.showAnotherFormRadioButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-checkbox-submit-another-form"]'); |
|
|
|
.locator('[data-pw="nc-form-checkbox-submit-another-form"]'); |
|
|
|
this.showAnotherFormAfter5SecRadioButton = dashboardPage |
|
|
|
this.showAnotherFormAfter5SecRadioButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-checkbox-show-blank-form"]'); |
|
|
|
.locator('[data-pw="nc-form-checkbox-show-blank-form"]'); |
|
|
|
this.emailMeRadioButton = dashboardPage |
|
|
|
this.emailMeRadioButton = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-checkbox-send-email"]'); |
|
|
|
.locator('[data-pw="nc-form-checkbox-send-email"]'); |
|
|
|
this.formHeading = dashboardPage |
|
|
|
this.formHeading = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-heading"]'); |
|
|
|
.locator('[data-pw="nc-form-heading"]'); |
|
|
|
this.formSubHeading = dashboardPage |
|
|
|
this.formSubHeading = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-sub-heading"]'); |
|
|
|
.locator('[data-pw="nc-form-sub-heading"]'); |
|
|
|
this.afterSubmitMsg = dashboardPage |
|
|
|
this.afterSubmitMsg = dashboard |
|
|
|
.get() |
|
|
|
.get() |
|
|
|
.locator('[data-pw="nc-form-after-submit-msg"]'); |
|
|
|
.locator('[data-pw="nc-form-after-submit-msg"]'); |
|
|
|
} |
|
|
|
} |
|
|
@ -246,6 +249,10 @@ export class FormPage extends BasePage { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async waitLoading() { |
|
|
|
|
|
|
|
await this.rootPage.waitForTimeout(1000); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
verifyAfterSubmitMenuState(param: { |
|
|
|
verifyAfterSubmitMenuState(param: { |
|
|
|
showBlankForm?: boolean; |
|
|
|
showBlankForm?: boolean; |
|
|
|
submitAnotherForm?: boolean; |
|
|
|
submitAnotherForm?: boolean; |
|
|
|