Folder structure of cypress cucumber framework
frontend/packages/dev-console/integration-tests/
├── support <--- cypress cucumber support configurations
| ├── commands <--- add commands to Cypress 'cy.' global, other support configurations
| | └── index.ts
| | └── app.ts <--- hooks are added in this file
| ├── pageObjects <--- helper objects
| | └── add-fow-po.ts <--- helper objects related to add page - git, catalog, container
| ├── constants <--- enums required for dev-console scripts
| | | └──static-text
| | | └── add-fow-text.ts <--- enums required for dev-console scripts
│ | └── add.ts
| | └── global.ts
| ├── pageObjects <--- Object Repository [Going forward will publish it as npm module]
│ | ├── add-flow-po.ts <--- Add flow related page objects
| | └── helm-po.ts <--- Helm related page objects
| ├── pages <--- page functions
│ | ├── add-flow <--- Add flow related helper objects and page functions
| | | └──add-page.ts
| | └── app.ts <--- Re-usable helper objects and page functions
| ├── step-definitions <--- cucumber step implementations
│ | ├── common <--- Re-usable dev-console step definitions
| | └──common.ts
| | └──project-creation.ts
├── features
| ├── addFlow <--- Add flow gherkin scenarios
| | └──create-from-git.feature
| ├── topology <--- Topology gherkin scenarios
| | └──chart-area-visual.feature
| ├── pipelines <--- Pipelines gherkin scenarios
| | └──create-from-builder-page.feature
| ├── knative <--- Knative gherkin scenarios
| | └──create-event-sources.feature
| ├── helm <--- Helm gherkin scenarios
| | └──helm-navigation.feature
| ├── BestPractices.md <--- Gherkin script standards
├── fixtures <--- Test data required for scripts
├── cypress.json <--- cypress configuration file
- Only validations should be present
- Don't use test data directly - It needs to be passed via data files (will use .ts files for now )
-
Page objects should be id, css selectors, buttontext etc.. [No XPath]- Already following
-
Each section should have one object as shown below (It helps to reduce the import list in scenarios)
export const deleteDeployPopupObj = { form: element(by.css('form.modal-content')), checkbox: element(by.css('input[type="checkbox"]')), cancel: element(by.css('[data-test-id="modal-cancel-action"]')), delete: element(by.css('#confirm-action')) }
-
-
Use arrow functions which helps to reduce the lines of code and it has other benefits as well
-
Logics should be implemented within these files
-
Don't use hard coded values [like waitTime]
- All test data should be maintained in these files
- Comment the scenario file name, If data is relevant to specific scenario
- If there is any functions which needs to be used in multiple files, include it in appFunctions file
- If functions are generic, include it in elementInteractions file
- Don't use static sleep statements (browser.sleep)
- Comments should be included wherever required
- Don't inlcude console.log statements while raising PR
- .gherkin-lintrc configuration file present in frontend folder is used to set Gherkin standards
- Execute the "yarn run gherkin-lint" command for every QE pr