Skip to content

Commit

Permalink
update other user roles
Browse files Browse the repository at this point in the history
  • Loading branch information
kristin-at-theta committed Oct 13, 2023
1 parent e4fb5c7 commit 820daca
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 57 deletions.
27 changes: 17 additions & 10 deletions tests/cypress/cypress/e2e/common/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ When("Clicking on FAQ Tab", () => {
});

When("Login with state submitter user", () => {
// OneMacDevLoginPage.loginAsStateSubmiiter();
OneMacDevLoginPage.loginAs("statesubmitter");
OneMacDevLoginPage.loginAs("statesubmitter", "active");
});
Then("click on New Submission", () => {
OneMacDashboardPage.clickNewSubmission();
Expand Down Expand Up @@ -170,10 +169,12 @@ Then("Add file for RAI Response", () => {
});
//this is for the oy2 8616
When("Login with cms role approver", () => {
OneMacDevLoginPage.loginAsCMSRoleApprover();
OneMacDevLoginPage.loginAs("cmsroleapprover", "active");
// OneMacDevLoginPage.loginAsCMSRoleApprover();
});
When("Login as EUA CMS Read Only User", () => {
OneMacDevLoginPage.loginAsEUACMSReadOnlyUser();
OneMacDevLoginPage.loginAs("cmsreadonly", "active");
// OneMacDevLoginPage.loginAsEUACMSReadOnlyUser();
});
Then("i am on User Management Page", () => {
OneMacUserManagmentPage.verifyWeAreOnUserManagmentPage();
Expand Down Expand Up @@ -226,17 +227,20 @@ Then("Actual Status is Displayed with Access Granted", () => {

// this uis for 8616
When("Login with cms System Admin", () => {
OneMacDevLoginPage.loginAsCMSSystemAdmin();
OneMacDevLoginPage.loginAs("systemadmin", "active");
// OneMacDevLoginPage.loginAsCMSSystemAdmin();
});
Then("Click on User Management Tab", () => {
OneMacDashboardPage.clickUserManagementTab();
});
// this is for oy2_10093
When("Login with cms Help Desk User", () => {
OneMacDevLoginPage.loginAsHelpDeskUser();
OneMacDevLoginPage.loginAs("helpdesk", "active");
// OneMacDevLoginPage.loginAsHelpDeskUser();
});
When("Login as a State System Admin", () => {
OneMacDevLoginPage.loginAsStateSystemAdmin();
OneMacDevLoginPage.loginAs("statesystemadmin", "active");
// OneMacDevLoginPage.loginAsStateSystemAdmin();
});
Then("i am on Dashboard Page", () => {
OneMacDashboardPage.verifyWeAreOnDashboardPage();
Expand Down Expand Up @@ -695,7 +699,8 @@ Then("click on Packages", () => {
});

When("Login with CMS Reviewer User", () => {
OneMacDevLoginPage.loginAsCMSReviewer();
OneMacDevLoginPage.loginAs("cmsreviewer", "active");
// OneMacDevLoginPage.loginAsCMSReviewer();
});

Then(
Expand Down Expand Up @@ -736,11 +741,13 @@ Then("Add file for 1915c Appendix K Amendment Waiver Template", () => {
});

When("Login with cms role approver Revoked", () => {
OneMacDevLoginPage.loginAsCMSUserRevoked();
OneMacDevLoginPage.loginAs("cmsroleapprover", "revoked");
// OneMacDevLoginPage.loginAsCMSUserRevoked();
});

When("Login with cms role approver Denied", () => {
OneMacDevLoginPage.loginAsCMSUserDenied();
OneMacDevLoginPage.loginAs("cmsroleapprover", "denied");
// OneMacDevLoginPage.loginAsCMSUserDenied();
});

Then("Verify General Section Exists", () => {
Expand Down
Binary file added tests/cypress/downloads/downloads.html
Binary file not shown.
96 changes: 49 additions & 47 deletions tests/cypress/support/pages/oneMacDevLoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,66 @@ const PasswordInput = "#password";
const LoginBtn = "#loginDevUserBtn";

export class oneMacDevLoginPage {
loginAs(userRole) {
cy.fixture(userRole).then(function (loginCredentials) {
loginAs(userRole, userStatus) {
const fixtureFile = `user-roles/${userRole}-${userStatus}.json`;

cy.fixture(fixtureFile).then(function (loginCredentials) {
cy.get(EmailInput).type(loginCredentials.name);
cy.get(PasswordInput).type(loginCredentials.word);
cy.get(LoginBtn).click();
});
}
loginAsStateSubmiiter() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsStateSubmiiter() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsCMSRoleApprover() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsCMSRoleApprover() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsCMSSystemAdmin() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsCMSSystemAdmin() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsHelpDeskUser() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
loginAsCMSReviewer() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsHelpDeskUser() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }
// loginAsCMSReviewer() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsCMSUserRevoked() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsCMSUserRevoked() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsCMSUserDenied() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsCMSUserDenied() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsStateSystemAdmin() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsStateSystemAdmin() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }

loginAsEUACMSReadOnlyUser() {
cy.get(EmailInput).type("[email protected]");
cy.get(PasswordInput).type("Passw0rd!");
cy.get(LoginBtn).click();
}
// loginAsEUACMSReadOnlyUser() {
// cy.get(EmailInput).type("[email protected]");
// cy.get(PasswordInput).type("Passw0rd!");
// cy.get(LoginBtn).click();
// }
}
export default oneMacDevLoginPage;

0 comments on commit 820daca

Please sign in to comment.