-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated e2e tests for add and topology pages
- Loading branch information
1 parent
38b459c
commit 621c136
Showing
5 changed files
with
142 additions
and
151 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...nd/packages/dev-console/integration-tests/features/addFlow/resource-quota-warning.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@add-flow @ODC6771 | ||
Feature: Update user in Add page if Quotas has been reached in a namespace | ||
If any resource reached resource quota limit, a warning alert will be displayed for the user in Add page. | ||
|
||
Background: | ||
Given user is at developer perspective | ||
And user has created or selected namespace "aut-add" | ||
|
||
|
||
@regression | ||
Scenario: single resource reached quota: A-15-TC01 | ||
Given user has created workload with resource type deployment | ||
When user creates resource quota 'resourcequota1' by entering "testData/resource-quota/resource-quota.yaml" file data | ||
And user is navigated to Add page | ||
And user clicks on link to view resource quota details | ||
Then user is redirected to resource quota details page | ||
|
||
|
||
@regression | ||
Scenario: multiple resources reached quota: A-15-TC02 | ||
Given user has created workload with resource type deployment | ||
And user creates two resource quotas | ||
When user is navigated to Add page | ||
And user clicks on link to view resource quota details | ||
Then user is redirected to resource quota list page | ||
|
69 changes: 69 additions & 0 deletions
69
.../dev-console/integration-tests/support/step-definitions/addFlow/resource-quota-warning.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; | ||
import { detailsPage } from '@console/cypress-integration-tests/views/details-page'; | ||
import { listPage } from '@console/cypress-integration-tests/views/list-page'; | ||
import { modal } from '@console/cypress-integration-tests/views/modal'; | ||
import * as yamlView from '@console/cypress-integration-tests/views/yaml-editor'; | ||
import { devNavigationMenu } from '@console/dev-console/integration-tests/support/constants'; | ||
import { | ||
navigateTo, | ||
createGitWorkloadIfNotExistsOnTopologyPage, | ||
topologyHelper, | ||
app, | ||
} from '@console/dev-console/integration-tests/support/pages'; | ||
|
||
const deteleResourceQuota = () => { | ||
detailsPage.isLoaded(); | ||
detailsPage.clickPageActionFromDropdown('Delete ResourceQuota'); | ||
modal.shouldBeOpened(); | ||
modal.submit(); | ||
modal.shouldBeClosed(); | ||
}; | ||
|
||
Given('user has created workload with resource type deployment', () => { | ||
createGitWorkloadIfNotExistsOnTopologyPage( | ||
'https://github.com/sclorg/nodejs-ex.git', | ||
'ex-node-js', | ||
'deployment', | ||
'nodejs-ex-git-app', | ||
); | ||
topologyHelper.verifyWorkloadInTopologyPage('ex-node-js'); | ||
}); | ||
|
||
Given('user creates two resource quotas', () => { | ||
cy.exec(`oc apply -f testData/resource-quota/resource-quota.yaml`); | ||
app.waitForDocumentLoad(); | ||
}); | ||
|
||
When('user is navigated to Add page', () => { | ||
app.waitForDocumentLoad(); | ||
navigateTo(devNavigationMenu.Add); | ||
}); | ||
|
||
When('user clicks on link to view resource quota details', () => { | ||
cy.byTestID('resource-quota-warning').click(); | ||
}); | ||
|
||
Then('user is redirected to resource quota details page', () => { | ||
cy.get('h2').should('contain.text', 'ResourceQuota details'); | ||
deteleResourceQuota(); | ||
}); | ||
|
||
Then('user is redirected to resource quota list page', () => { | ||
listPage.rows.shouldBeLoaded(); | ||
}); | ||
|
||
When( | ||
'user creates resource quota {string} by entering {string} file data', | ||
(resourceQuotaName: string, yamlLocation: string) => { | ||
cy.get('[data-test="import-yaml"]').click(); | ||
cy.get('.yaml-editor').should('be.visible'); | ||
cy.readFile(yamlLocation).then((str) => { | ||
const myArray = str.split('---'); | ||
resourceQuotaName === 'resourcequota1' | ||
? yamlView.setEditorContent(myArray[0]) | ||
: yamlView.setEditorContent(myArray[1]); | ||
}); | ||
cy.get('[data-test="save-changes"]').click(); | ||
cy.get('h2').should('contain.text', 'ResourceQuota details'); | ||
}, | ||
); |
17 changes: 17 additions & 0 deletions
17
frontend/packages/dev-console/integration-tests/testData/resource-quota/resource-quota.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: ResourceQuota | ||
metadata: | ||
name: resourcequota1 | ||
namespace: aut-add | ||
spec: | ||
hard: | ||
pods: '1' | ||
--- | ||
apiVersion: v1 | ||
kind: ResourceQuota | ||
metadata: | ||
name: resourcequota2 | ||
namespace: aut-add | ||
spec: | ||
hard: | ||
pods: '1' |
79 changes: 16 additions & 63 deletions
79
...tend/packages/topology/integration-tests/features/topology/resource-quota-warning.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,27 @@ | ||
@topology @add-flow @ODC6771 | ||
Feature: Update user in topology and add flow if Quotas has been reached in a namespace | ||
If any resource reached resource quota limit, a warning alert will be displayed for the user in Add page and Topology page. | ||
@topology @ODC6771 | ||
Feature: Update user in topology page if Quotas has been reached in a namespace | ||
If any resource reached resource quota limit, a warning alert will be displayed for the user in Topology page. | ||
|
||
Background: | ||
Given user is at developer perspective | ||
And user has created or selected namespace "aut-topology" | ||
|
||
|
||
@regression | ||
Scenario: Deploy git workload with devfile from topology page: T-19-TC01 | ||
Given user is at the Topology page | ||
When user right clicks on topology empty graph | ||
And user selects "Import from Git" option from Add to Project context menu | ||
And user enters Git Repo URL as "https://github.com/nodeshift-starters/devfile-sample" in Import from Git form | ||
And user enters workload name as "node-bulletin-board-1" | ||
And user clicks Create button on Add page | ||
Then user will be redirected to Topology page | ||
And user is able to see workload "node-bulletin-board-1" in topology page | ||
|
||
|
||
@regression | ||
Scenario: user creates a resource quota: T-19-TC02 | ||
Given user clicks on import YAML button | ||
Scenario: single resource reached quota: T-19-TC01 | ||
Given user has created workload with resource type deployment | ||
When user creates resource quota 'resourcequota1' by entering "testData/resource-quota/resource-quota.yaml" file data | ||
And user clicks on Create button | ||
Then user is redirected to resource quota details page | ||
|
||
|
||
@regression | ||
Scenario: check resource quota reached warning message in topology page: T-19-TC03 | ||
Given user is at the Topology page | ||
When user clicks on link to view resource quota details | ||
Then user is redirected to resource quota details page | ||
|
||
|
||
@regression | ||
Scenario: check resource quota reached warning message in Add page: T-19-TC04 | ||
Given user is at the Add page | ||
When user clicks on link to view resource quota details | ||
Then user is redirected to resource quota details page | ||
|
||
|
||
@regression | ||
Scenario: user creates another resource quota: T-19-TC05 | ||
Given user clicks on import YAML button | ||
When user creates resource quota 'resourcequota2' by entering "testData/resource-quota/resource-quota.yaml" file data | ||
And user clicks on Create button | ||
And user is navigated to Topology page | ||
And user clicks on link to view resource quota details | ||
Then user is redirected to resource quota details page | ||
|
||
|
||
@regression | ||
Scenario: Click on warning message link to see the resource quotas list in toplology page: T-19-TC06 | ||
Given user is at the Topology page | ||
When user clicks on link to view resource quota details | ||
|
||
|
||
@regression | ||
Scenario: multiple resources reached quota: T-19-TC02 | ||
Given user has created workload with resource type deployment | ||
And user creates two resource quotas | ||
When user is navigated to Topology page | ||
And user clicks on link to view resource quota details | ||
Then user is redirected to resource quota list page | ||
|
||
|
||
@regression | ||
Scenario: Click on warning message link to see the resource quotas list in Add page: T-19-TC07 | ||
Given user is at the Add page | ||
When user clicks on link to view resource quota details | ||
And user is redirected to resource quota list page | ||
And user deletes resource quotas created | ||
Then user should not be able to see the resource quotas "resourcequota1" and "resourcequota2" | ||
|
||
|
||
@regression | ||
Scenario: Delete the application created: A-04-TC01: T-19-TC08 | ||
Given user is at the Topology page | ||
When user right clicks on Application Grouping "devfile-sample-app" | ||
And user clicks on Delete application | ||
And user enters the name "devfile-sample-app" in the Delete application modal and clicks on Delete button | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters