ToolJet/cypress/support/utils/profile.js
Ajith KV cb678190d7
Cypress test for the profile settings page (#3083)
* Added cypress test for profile settings page

* Updated common selectors

* Updated common text

* Added functions for random names

* Added data-cy attributes for components

* Added verification for the input value

* Added password field validation

* Added common utils file

* Added wait

* Updated login error toast
2022-06-01 13:42:53 +05:30

16 lines
1 KiB
JavaScript

import { profileSelector } from "Selectors/profile";
import { profileText } from "Texts/profile";
export const profilePageElements = () =>{
for(const elements in profileSelector.profileElements ){
cy.get(profileSelector.profileElements[elements]).should("be.visible").and("have.text",profileText.profileElements[elements]);
}
cy.get(profileSelector.updateButton).should("be.visible").and("have.text", profileText.updateButton);
cy.get(profileSelector.changePasswordButton).should("be.visible").and("have.text", profileText.changePasswordButton);
cy.get(profileSelector.firstNameInput).should("be.visible").and("have.value", profileText.firstName);
cy.get(profileSelector.lastNameInput).should("be.visible").and("have.value", profileText.lastName);
cy.get(profileSelector.emailInput).should("be.visible").and("have.value", profileText.email);
cy.get(profileSelector.currentPasswordField).should("be.visible").should("be.visible");
cy.get(profileSelector.newPasswordField).should("be.visible").should("be.visible");
};