Skip to content

Commit

Permalink
too much logic too deep with this setup...
Browse files Browse the repository at this point in the history
  • Loading branch information
kristin-at-theta committed Oct 17, 2023
1 parent 6b1b027 commit 1075381
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Feature: Package Dashboard - State User Revoked experience
When Login with state submitter user

Scenario: SPAs Tab - Screen enhancement
Then verify state user columns work as expected
Then verify state user SPA tab columns work as expected
Then click on the Waivers tab
Then verify state user Waiver tab columns work as expected
Then Click on My Account
Then click the logout button
7 changes: 5 additions & 2 deletions tests/cypress/cypress/e2e/common/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,11 @@ Then("verify the SPAs tab exists", () => {
Then("verify SPA ID column exists", () => {
OneMacPackagePage.verifySPAIDColumnExists();
});
Then("verify state user columns work as expected", () => {
OneMacDashboardPage.verifyColumns("stateuser");
Then("verify state user SPA tab columns work as expected", () => {
OneMacDashboardPage.verifyColumns("stateuser", "spaTab");
});
Then("verify state user Waiver tab columns work as expected", () => {
OneMacDashboardPage.verifyColumns("stateuser", "waiverTab");
});
Then("verify state user columns are not shown", () => {
OneMacDashboardPage.verifyNoColumns("stateuser");
Expand Down
Binary file removed tests/cypress/downloads/downloads.html
Binary file not shown.
70 changes: 70 additions & 0 deletions tests/cypress/fixtures/dashboard/cmsuser-columns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"testComment": "Active CMS users (readonlys, reviewers, and admins) should see/not see the same columns.",
"relatedStories": [
"oy2-13095: Package Dashboard - Column Picker"
],
"idColumn": {
"id": "#componentIdColHeader",
"spaTabLabel": "SPA ID",
"waiverTabLabel": "Waiver Number",
"defaultState": "be.visible",
"hasCheckbox": false
},
"dataColumns": [
{
"id": "#territoryColHeader",
"label": "State",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#componentTypeColHeader",
"label": "Type",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#packageStatusColHeader",
"label": "Status",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#submissionTimestampColHeader",
"label": "Initial Submission",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#latestRaiResponseTimestampColHeader",
"label": "Formal RAI Response",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#submitterColHeader",
"label": "Submitted By",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},
{
"id": "#cpocNameColHeader",
"label": "CPOC Name",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},
{
"id": "#packageActionsColHeader",
"label": "Actions",
"defaultState": "not.be.visible",
"hasCheckbox": false
}
]
}
115 changes: 65 additions & 50 deletions tests/cypress/fixtures/dashboard/stateuser-columns.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,71 @@
{
"testComment": "Active state users (both submitters and admins) should see/not see the same columns.",
"columns": [{
"relatedStories": [
"oy2-13095: Package Dashboard - Column Picker",
"OY2-3525: State User can view columns in a table on Dashboard"
],
"idColumn": {
"id": "#componentIdColHeader",
"label": "SPA ID",
"spaTabLabel": "SPA ID",
"waiverTabLabel": "Waiver Number",
"defaultState": "be.visible",
"hasCheckbox": false
},{
"id": "#componentTypeColHeader",
"label": "Type",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},{
"id": "#packageStatusColHeader",
"label": "Status",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},{
"id": "#submissionTimestampColHeader",
"label": "Initial Submission",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},{
"id": "#latestRaiResponseTimestampColHeader",
"label": "Formal RAI Response",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},{
"id": "#submitterColHeader",
"label": "Submitted By",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},{
"id": "#territoryColHeader",
"label": "State",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},{
"id": "#cpocNameColHeader",
"label": "CPOC Name",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},{
"id": "#packageActionsColHeader",
"label": "Actions",
"defaultState": "be.visible",
"hasCheckbox": false
}]
},
"dataColumns": [
{
"id": "#componentTypeColHeader",
"label": "Type",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#packageStatusColHeader",
"label": "Status",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#submissionTimestampColHeader",
"label": "Initial Submission",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#latestRaiResponseTimestampColHeader",
"label": "Formal RAI Response",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#submitterColHeader",
"label": "Submitted By",
"defaultState": "be.visible",
"hasCheckbox": true,
"toggleState": "not.be.visible"
},
{
"id": "#territoryColHeader",
"label": "State",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},
{
"id": "#cpocNameColHeader",
"label": "CPOC Name",
"defaultState": "not.be.visible",
"hasCheckbox": true,
"toggleState": "be.visible"
},
{
"id": "#packageActionsColHeader",
"label": "Actions",
"defaultState": "be.visible",
"hasCheckbox": false
}
]
}
45 changes: 27 additions & 18 deletions tests/cypress/support/pages/oneMacDashboardPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,39 @@ export class oneMacDashboardPage {
verifyActionsBtnDisabledOnFirstRow() {
cy.get(actionsRowOne).find("button").should("be.disabled");
}

// Kristin's section...
verifyColumns(userType) {
const fixtureFile = `dashboard/${userType}-columns.json`;
verifyColumnDetails({ id, label, defaultState, hasCheckbox, toggleState }) {
const toggleButton = cy.xpath(ShowHideColumnsBTN);
toggleButton.scrollIntoView();
toggleButton.should("be.visible");

cy.fixture(fixtureFile).then((columnDetails) => {
columnDetails?.columns?.forEach(
({ id, label, defaultState, hasCheckbox }) => {
const column = cy.get(id);
const columnLabelElement = cy.get(id);

columnLabelElement.scrollIntoView();
columnLabelElement.should(defaultState);
defaultState === "be.visible" && columnLabelElement.contains(label);
if (hasCheckbox) {
toggleButton.click();
const toggleCheckbox = cy.xpath(
`//label[contains(@for,'checkbox_columnPicker-${label}')]`
);
toggleCheckbox.should("exist");
toggleCheckbox.click();
toggleButton.click();
columnLabelElement.should(toggleState);
toggleState === "be.visible" && columnLabelElement.contains(label);
}
}
verifyColumns(userType, selectedTab) {
const fixtureFile = `dashboard/${userType}-columns.json`;

column.scrollIntoView();
column.should(defaultState);
defaultState === "be.visible" && column.contains(label);
if (hasCheckbox) {
toggleButton.click();
const toggleCheckbox = cy.xpath(
`//label[contains(@for,'checkbox_columnPicker-${label}')]`
);
toggleCheckbox.should("exist");
}
}
cy.fixture(fixtureFile).then((columnDetails) => {
this.verifyColumnDetails({
...columnDetails.idColumn,
label: columnDetails.idColumn[`${selectedTab}Label`],
});
columnDetails?.dataColumns?.forEach((column) =>
this.verifyColumnDetails(column)
);
});
}
Expand Down

0 comments on commit 1075381

Please sign in to comment.