2021-10-19 15:30:57 +00:00
|
|
|
export default class RequiredActions {
|
|
|
|
private toId(name: string) {
|
|
|
|
return name.replace(/\s/g, "\\ ");
|
|
|
|
}
|
2022-06-28 12:23:38 +00:00
|
|
|
|
|
|
|
private toKey(name: string) {
|
|
|
|
return name.replace(/\s/g, "-");
|
|
|
|
}
|
|
|
|
|
2021-10-19 15:30:57 +00:00
|
|
|
private getEnabled(name: string) {
|
2022-06-28 12:23:38 +00:00
|
|
|
return `#enable-${this.toKey(name)}`;
|
2021-10-19 15:30:57 +00:00
|
|
|
}
|
|
|
|
private getDefault(name: string) {
|
2022-06-28 12:23:38 +00:00
|
|
|
return `#default-${this.toKey(name)}`;
|
2021-10-19 15:30:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
goToTab() {
|
2022-06-22 11:35:10 +00:00
|
|
|
cy.findByTestId("requiredActions").click();
|
2021-10-19 15:30:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enableAction(name: string) {
|
|
|
|
cy.get(this.getEnabled(name)).click({ force: true });
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
isChecked(name: string) {
|
|
|
|
cy.get(this.getEnabled(name)).should("be.checked");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
isDefaultEnabled(name: string) {
|
|
|
|
cy.get(this.getDefault(name)).should("be.enabled");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
setAsDefault(name: string) {
|
|
|
|
cy.get(this.getDefault(name)).click({ force: true });
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
isDefaultChecked(name: string) {
|
|
|
|
cy.get(this.getEnabled(name)).should("be.checked");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
moveRowTo(from: string, to: string) {
|
2022-06-28 12:23:38 +00:00
|
|
|
cy.get("#" + this.toId(from)).drag("#" + this.toId(to));
|
2021-10-19 15:30:57 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|