Skip to content

Commit

Permalink
e2e(4313): add approval test for Public Cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
funtigr committed Jan 9, 2025
1 parent 076e4b5 commit 8dca2d3
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 43 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/1. create-request-private-test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: New Request
Scenario: Create Private Cloud Request and check visibility
Given User logs in with username "[email protected]" and password "[email protected]"
When User clicks tab "PRIVATE CLOUD OPENSHIFT"
And User clicks button "REQUEST A NEW PRODUCT"
And User clicks button "Request a new product"
And User types "Automated Test Product Name" in "Product name"
And User types "Automated Test Description" in "Description"
And User selects "Citizens Services" in "Ministry"
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/3. delete-product-test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Feature: Delete Request
And User clicks button "Approve"
And User clicks modal window button "Submit"
And User clicks modal window button "Return to Dashboard"
And User waits for "7" seconds
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User clicks tab "PRIVATE CLOUD OPENSHIFT"
Expand Down
30 changes: 14 additions & 16 deletions cypress/integration/4. approve-requests-private.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Requests Review
Background:
Feature: Requests Review Private Cloud
Scenario: Approval Admin reviews New Request
Given User logs in with username "[email protected]" and password "[email protected]"
When User clicks tab "PRIVATE CLOUD OPENSHIFT"
And User clicks button "Request a new product"
Expand All @@ -21,8 +21,6 @@ Feature: Requests Review
Then User should be redirected to Requests tab
And User should see "Automated Test Product Name"
And User logs out

Scenario: Approval Admin reviews New Request
When User logs in with username "[email protected]" and password "[email protected]"
And User clicks tab "PRIVATE CLOUD OPENSHIFT"
And User waits for "3" seconds
Expand Down Expand Up @@ -51,18 +49,18 @@ Scenario: Approval Admin reviews Edit Request
And User clicks button "ADD SECONDARY TECHNICAL LEAD"
And User types and selects Secondary Tech Lead "[email protected]"
And User clicks tab "Quotas"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Production"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Production"
And User selects quota "4 GB" in "STORAGE" for "Production"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Test"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Test"
And User selects quota "4 GB" in "STORAGE" for "Test"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Tools"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Tools"
And User selects quota "4 GB" in "STORAGE" for "Tools"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Development"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Development"
And User selects quota "4 GB" in "STORAGE" for "Development"
And User types quota "1" in "CPU" for "Development"
And User types quota "3" in "MEMORY" for "Development"
And User types quota "2" in "STORAGE" for "Development"
And User types quota "1" in "CPU" for "Test"
And User types quota "3" in "MEMORY" for "Test"
And User types quota "2" in "STORAGE" for "Test"
And User types quota "1" in "CPU" for "Production"
And User types quota "3" in "MEMORY" for "Production"
And User types quota "2" in "STORAGE" for "Production"
And User types quota "1" in "CPU" for "Tools"
And User types quota "3" in "MEMORY" for "Tools"
And User types quota "2" in "STORAGE" for "Tools"
And User types justification "John Cypress" in "Contact name"
And User types justification "[email protected]" in "Contact email"
And User types justification "Test Justification text, test-test, 123" in "Justification of quota increase"
Expand Down
119 changes: 119 additions & 0 deletions cypress/integration/5. approve-requests-public.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Feature: Requests Review Public Cloud
Scenario: Approval Admin reviews New Request
Given User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User clicks button "Request a new product"
And User types "Automated Test Product Name" in "Product name"
And User types "Automated Test Description" in "Description"
And User selects "Citizens Services" in "Ministry"
And User selects "AWS" in "Cloud Service Provider"
And User clicks and selects "Cost efficiency" in "Select reason for choosing cloud provider"
And User types "Test reason for choosing Cl. Prov." in "Description of reason(s) for selecting cloud provider"
And User clicks tab "Accounts to create"
And User clicks button "Select None"
And User checks checkbox "Test account"
And User checks checkbox "Tools account"
And User clicks tab "Team contacts"
And User types and selects "[email protected]" in "Product Owner email"
And User waits for "2" seconds
And User types and selects "[email protected]" in "Technical Lead email"
And User clicks tab "Expense authority"
And User types and selects "[email protected]" in "Expense Authority email"
And User clicks tab "Project budget"
And User types "77.33" in "Estimated average monthly spend - Test..."
And User types "111.22" in "Estimated average monthly spend - Tool..."
And User clicks tab "Billing (account coding)"
And User types "213" in "Client Code"
And User types "4A5B6" in "Responsibility Centre (RC)"
And User types "78901" in "Service Line (SL)"
And User types "2345" in "Standard Object of Expense (STOB)"
And User types "6789012" in "Project Code"
And User clicks button "Submit"
And User checks checkbox "No eMOU exists for this account coding."
And User checks checkbox "...team is liable to pay the base charge..."
And User clicks modal window button "Submit"
And User waits for "4" seconds
And User clicks modal window button "Close"
Then User should be redirected to Requests tab
And User should see "Automated Test Product Name"
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User waits for "3" seconds
And User clicks tab "Requests"
And User waits for "3" seconds
And User clicks link "Automated Test Product Name"
And User clicks button "Sign eMOU"
And User checks checkbox "By checking this box, I confirm..."
And User clicks modal window button "Confirm"
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User waits for "3" seconds
And User clicks tab "Requests"
And User waits for "3" seconds
And User clicks link "Automated Test Product Name"
And User clicks button "Review eMOU"
And User checks checkbox "By checking this box, I confirm..."
And User clicks modal window button "Confirm"
And User waits for "5" seconds
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User waits for "3" seconds
And User clicks tab "Requests"
And User waits for "3" seconds
And User clicks link "Automated Test Product Name"
And User clicks button "Approve"
And User clicks modal window button "Submit"
And User clicks modal window button "Return to Dashboard"
And User clicks tab "Products"
And User waits for "3" seconds
And User reloads the page
And User waits for "3" seconds
Then User should see "Automated Test Product Name"
And User logs out

Scenario: Approval Admin reviews Edit Request
And User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User waits for "3" seconds
And User clicks link "Automated Test Product Name"
And User waits for "10" seconds
And User types "Automated Test Edit Request" in "Product name"
And User types "Automated Test Description Edit" in "Description"
And User selects "Finance" in "Ministry"
And User clicks tab "Accounts to create"
And User checks checkbox "Development account"
And User clicks tab "Team contacts"
And User types and selects "[email protected]" in "Product Owner email"
And User waits for "2" seconds
And User types and selects "[email protected]" in "Technical Lead email"
And User clicks button "ADD SECONDARY TECHNICAL LEAD"
And User types and selects Secondary Tech Lead "[email protected]"
And User clicks tab "Expense authority"
And User types and selects "[email protected]" in "Expense Authority email"
And User clicks tab "Project budget"
And User types "55.55" in "Estimated average monthly spend - Test..."
And User types "66.66" in "Estimated average monthly spend - Tool..."
And User types "77.77" in "Estimated average monthly spend - Development..."
And User clicks button "Submit"
And User clicks modal window button "Submit"
And User waits for "5" seconds
And User clicks modal window button "Close"
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User waits for "3" seconds
When User clicks tab "PUBLIC CLOUD LANDING ZONES"
And User waits for "3" seconds
Then User should see "Automated Test Edit Request"
And User clicks link "Automated Test Edit Request"
And User waits for "5" seconds
Then User sees "Automated Test Edit Request" in "Product name"
And User sees "Automated Test Description Edit" in "Description"
And User logs out
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Feature: Edit Request
And User logs out
And User logs in with username "[email protected]" and password "[email protected]"
And User clicks tab "PRIVATE CLOUD OPENSHIFT"
And User clicks tab "PRIVATE CLOUD OPENSHIFT"
When User clicks link "Automated Test Product Name"
And User waits for "10" seconds
And User types "Automated Test Edit Request" in "Product name"
Expand All @@ -47,18 +46,18 @@ Feature: Edit Request
And User clicks button "ADD SECONDARY TECHNICAL LEAD"
And User types and selects Secondary Tech Lead "[email protected]"
And User clicks tab "Quotas"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Production"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Production"
And User selects quota "4 GB" in "STORAGE" for "Production"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Test"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Test"
And User selects quota "4 GB" in "STORAGE" for "Test"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Tools"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Tools"
And User selects quota "4 GB" in "STORAGE" for "Tools"
And User selects quota "4 CPU Request, 8 CPU Limit" in "CPU" for "Development"
And User selects quota "4 GB Request, 8 GB Limit" in "MEMORY" for "Development"
And User selects quota "4 GB" in "STORAGE" for "Development"
And User types quota "1" in "CPU" for "Development"
And User types quota "3" in "MEMORY" for "Development"
And User types quota "2" in "STORAGE" for "Development"
And User types quota "1" in "CPU" for "Test"
And User types quota "3" in "MEMORY" for "Test"
And User types quota "2" in "STORAGE" for "Test"
And User types quota "1" in "CPU" for "Production"
And User types quota "3" in "MEMORY" for "Production"
And User types quota "2" in "STORAGE" for "Production"
And User types quota "1" in "CPU" for "Tools"
And User types quota "3" in "MEMORY" for "Tools"
And User types quota "2" in "STORAGE" for "Tools"
And User types justification "John Cypress" in "Contact name"
And User types justification "[email protected]" in "Contact email"
And User types justification "Test Justification text, test-test, 123" in "Justification of quota increase"
Expand Down
24 changes: 11 additions & 13 deletions cypress/support/step_definitions/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,17 @@ When(/^User selects "(.*)" in "(.*)"$/, (entryText: string, dropdownLabel: strin
cy.contains('label', dropdownLabel).scrollIntoView().parent().find('input, select').select(entryText);
});

When(
/^User selects quota "(.*)" in "(.*)" for "(.*)"$/,
(entryText: string, dropdownLabel: string, envLabel: string) => {
cy.contains('h3', envLabel)
.parent()
.find('label')
.contains(dropdownLabel)
.parent()
.find('select')
.scrollIntoView()
.select(entryText);
},
);
When(/^User types quota "(.*)" in "(.*)" for "(.*)"$/, (value: string, resourceType: string, envLabel: string) => {
cy.contains('h3', envLabel)
.parent()
.find('label')
.contains(resourceType)
.closest('.text-input')
.find('input')
.scrollIntoView()
.clear()
.type(value);
});

When(/^User checks checkbox "(?:\.\.\.)?(.*?)(?:\.\.\.)?"$/, (checkboxLabel: string) => {
cy.contains('label', checkboxLabel).scrollIntoView().parent().parent().find('input').first().click();
Expand Down

0 comments on commit 8dca2d3

Please sign in to comment.