Skip to content

Commit

Permalink
refactor: unify naming used in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Dec 6, 2023
1 parent e88a0d0 commit c76e763
Show file tree
Hide file tree
Showing 48 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/add-job/back-to-all-jobs.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Users should be able to navigate back to the list route

Background:
Given the user navigated to the add job page
Given the user navigated to the add job route

Scenario: User clicks the cancel button
When the user clicks the cancel button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-job/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'

Given('the user navigated to the add job page', () => {
Given('the user navigated to the add job route', () => {
cy.visit('/#/job/add')
cy.findByRole('heading', { name: 'New Job' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-job/create-parameter-jobs.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Users should be able to create jobs that take parameters

Scenario Outline: User creates a <job-type> job
Given the user navigated to the add job page
Given the user navigated to the add job route
And the user enters a job name
And the user selects the <job-type> job type
And the user enters a <schedule-type> schedule
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-job/create-parameter-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const saveAndExpect = (expected) => {
* Tests
*/

Given('the user navigated to the add job page', () => {
Given('the user navigated to the add job route', () => {
cy.visit('/#/job/add')
cy.findByRole('heading', { name: 'New Job' }).should('exist')
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Users should be able to create jobs without parameters

Scenario Outline: User creates a <job-type> job
Given the user navigated to the add job page
Given the user navigated to the add job route
And the user enters a job name
And the user selects the <job-type> job type
And the user enters a cron schedule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const saveAndExpect = (expected) => {
* Tests
*/

Given('the user navigated to the add job page', () => {
Given('the user navigated to the add job route', () => {
cy.visit('/#/job/add')
cy.findByRole('heading', { name: 'New Job' }).should('exist')
})
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/add-job/cron-presets.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Users should be able to insert cron presets

Scenario: User inserts a cron preset
Given the user navigated to the add job page
Given the user navigated to the add job route
And the job types have loaded
And the user selects a cron scheduled job type
When the user clicks the choose from preset times button
Expand All @@ -10,7 +10,7 @@ Feature: Users should be able to insert cron presets
Then the selected cron schedule will be inserted in the form

Scenario: User cancels inserting a cron preset
Given the user navigated to the add job page
Given the user navigated to the add job route
And the job types have loaded
And the user selects a cron scheduled job type
When the user clicks the choose from preset times button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-job/cron-presets/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'

Given('the user navigated to the add job page', () => {
Given('the user navigated to the add job route', () => {
cy.visit('/#/job/add')
cy.findByRole('heading', { name: 'New Job' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-job/info-link.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Users should be able to navigate to the documentation

Scenario: User clicks the info link
Given the user navigated to the add job page
Given the user navigated to the add job route
Then there is a link to the documentation
2 changes: 1 addition & 1 deletion cypress/integration/add-job/info-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
const infoHref =
'https://docs.dhis2.org/en/use/user-guides/dhis-core-version-master/maintaining-the-system/scheduling.html'

Given('the user navigated to the add job page', () => {
Given('the user navigated to the add job route', () => {
cy.visit('/#/job/add')
cy.findByRole('heading', { name: 'New Job' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-queue/back-to-all-jobs.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Users should be able to navigate back to the list route

Background:
Given the user navigated to the add sequence page
Given the user navigated to the add sequence route

Scenario: User clicks the cancel button
When the user clicks the cancel button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-queue/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'

Given('the user navigated to the add sequence page', () => {
Given('the user navigated to the add sequence route', () => {
cy.visit('/#/queue/add')
cy.findByRole('heading', { name: 'New queue' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-queue/create-sequence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to create a sequence

Scenario: User creates a sequence
Given two unqueued jobs exist
And the user navigated to the add sequence page
And the user navigated to the add sequence route
And the user enters a sequence name
And the user enters a cron schedule
And the user adds jobs to the queue
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/add-queue/create-sequence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Given('two unqueued jobs exist', () => {
)
})

Given('the user navigated to the add sequence page', () => {
Given('the user navigated to the add sequence route', () => {
cy.visit('/#/queue/add')
cy.findByRole('heading', { name: 'New queue' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/back-to-all-jobs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to navigate back to the list route

Background:
Given a single user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route

Scenario: User clicks the cancel button
When the user clicks the cancel button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Given('a single user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/cron-presets.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to insert cron presets

Background:
Given a single cron scheduled user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route

Scenario: User inserts a cron preset
When the user clicks the choose from preset times button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/cron-presets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Given('a single cron scheduled user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/delete-button.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to delete a job

Background:
Given a single user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route
And the user clicks the delete job button

Scenario: User deletes a job
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/delete-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Given('a single user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/display-jobs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Feature: Users should be able to view jobs

Scenario: User views a user job
Given a single user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route
Then the user job data should be displayed in the form
And the user job details should be visible
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/display-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Given('a single user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
// Set fixed date so that time based job details tests don't change
const now = new Date(2021, 3, 10).getTime()
cy.clock(now)
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/edit-parameter-jobs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to edit jobs that take parameters

Scenario Outline: User edits a <job-type> job
Given a single user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route
And the user enters a job name
And the user selects the <job-type> job type
And the user enters a <schedule-type> schedule
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/edit-parameter-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Given('a single user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to edit jobs without parameters

Scenario Outline: User edits a <job-type> job
Given a single user job with parameters exists
And the user navigated to the edit job page
And the user navigated to the edit job route
And the user enters a job name
And the user selects the <job-type> job type
And the user enters a cron schedule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Given('a single user job with parameters exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/info-link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Feature: Users should be able to navigate to the documentation

Scenario: User clicks the info link
Given a single user job exists
And the user navigated to the edit job page
And the user navigated to the edit job route
Then there is a link to the documentation
2 changes: 1 addition & 1 deletion cypress/integration/edit-job/info-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Given('a single user job exists', () => {
)
})

Given('the user navigated to the edit job page', () => {
Given('the user navigated to the edit job route', () => {
cy.visit('/#/job/lnWRZN67iDU')
cy.findByRole('heading', { name: 'Job: Job 1' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-queue/back-to-all-jobs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to navigate back to the list route

Background:
Given a sequence exists
And the user navigates to the edit sequence page
And the user navigates to the edit sequence route

Scenario: User clicks the cancel button
When the user clicks the cancel button
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-queue/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Given('a sequence exists', () => {
)
})

Given('the user navigates to the edit sequence page', () => {
Given('the user navigates to the edit sequence route', () => {
cy.visit('/#/queue/one')
cy.findByRole('heading', { name: 'Queue: one' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-queue/edit-sequence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Users should be able to edit a sequence

Scenario: User edits a sequence
Given a sequence with two unqueued jobs exists
And the user navigates to the edit sequence page
And the user navigates to the edit sequence route
And the user changes the sequence name
And the user changes the cron schedule
And the user adds jobs to the queue
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/edit-queue/edit-sequence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Given('a sequence with two unqueued jobs exists', () => {
)
})

Given('the user navigates to the edit sequence page', () => {
Given('the user navigates to the edit sequence route', () => {
cy.visit('/#/queue/one')
cy.findByRole('heading', { name: 'Queue: one' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/list/actions-queue.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Queue actions

Background:
Given a single queue exists
And the user navigated to the list page
And the user navigated to the list route
And the user clicks the actions button

Scenario: User clicks the edit queue button on a queue
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/list/actions-queue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Given('a single queue exists', () => {
)
})

Given('the user navigated to the list page', () => {
Given('the user navigated to the list route', () => {
cy.visit('/')
cy.findByRole('heading', { name: 'Scheduled jobs' }).should('exist')
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/list/list-queues.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Queues should be listed

Scenario: View a queue
Given a queue exists
And the user navigated to the list page
And the user navigated to the list route
Then the queue is rendered as tabular data
And the user clicks the expand button
Then the queued jobs are shown
2 changes: 1 addition & 1 deletion cypress/integration/list/list-queues/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Given('a queue exists', () => {
)
})

Given('the user navigated to the list page', () => {
Given('the user navigated to the list route', () => {
cy.visit('/')
cy.findByRole('heading', { name: 'Scheduled jobs' }).should('exist')
})
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/list/new-job.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Users should be able to navigate to the new job route

Scenario: User clicks the new job button
Given the user navigated to the list page
Then there is a link to the new job page
Given the user navigated to the list route
Then there is a link to the new job route
4 changes: 2 additions & 2 deletions cypress/integration/list/new-job/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('the user navigated to the list page', () => {
Given('the user navigated to the list route', () => {
cy.visit('/')
cy.findByRole('heading', { name: 'Scheduled jobs' }).should('exist')
})

Then('there is a link to the new job page', () => {
Then('there is a link to the new job route', () => {
cy.findByRole('link', { name: 'New job' })
.should('exist')
.should('have.attr', 'href', '#/job/add')
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/list/new-queue.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Users should be able to navigate to the new queue route

Scenario: User clicks the new queue button
Given the user navigated to the list page
Then there is a link to the new queue page
Given the user navigated to the list route
Then there is a link to the new queue route
4 changes: 2 additions & 2 deletions cypress/integration/list/new-queue/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('the user navigated to the list page', () => {
Given('the user navigated to the list route', () => {
cy.visit('/')
cy.findByRole('heading', { name: 'Scheduled jobs' }).should('exist')
})

Then('there is a link to the new queue page', () => {
Then('there is a link to the new queue route', () => {
cy.findByRole('link', { name: 'New queue' })
.should('exist')
.should('have.attr', 'href', '#/queue/add')
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/list/toggle-queue.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Feature: Queues can be enabled and disabled

Scenario: The user enables a queue
Given a disabled queue exists
And the user navigated to the list page
And the user navigated to the list route
And the queue toggle switch is off
When the user clicks the disabled queue toggle switch
Then the queue toggle switch is on

Scenario: The user disables a queue
Given an enabled queue exists
And the user navigated to the list page
And the user navigated to the list route
And the queue toggle switch is on
When the user clicks the enabled queue toggle switch
Then the queue toggle switch is off
2 changes: 1 addition & 1 deletion cypress/integration/list/toggle-queue/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Given('an enabled queue exists', () => {
)
})

Given('the user navigated to the list page', () => {
Given('the user navigated to the list route', () => {
cy.visit('/')
cy.findByRole('heading', { name: 'Scheduled jobs' }).should('exist')
})
Expand Down
Loading

0 comments on commit c76e763

Please sign in to comment.