Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cypress): update to v13 #1466

Merged
merged 19 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
abe86cf
chore(cypress): update to v12 and fix failing tests
Mohammer5 Mar 21, 2024
1e9057e
chore: fix linter issues
Mohammer5 Mar 21, 2024
e9822bc
chore(gh workflows): use node version 18.x
Mohammer5 Mar 21, 2024
0ed7c47
chore(github actions): use node version 20
Mohammer5 Apr 8, 2024
bd55ee9
chore: make cucumber evaluate local common files
Mohammer5 Apr 18, 2024
bb0f6c9
chore(step definition files): automatically resolve "../common/index.…
Mohammer5 Apr 18, 2024
30939bb
chore(cypress): update to v13
Mohammer5 Apr 23, 2024
bbcdda7
chore(cypress config): remove commented out config & allow experiment…
Mohammer5 Apr 23, 2024
2c91a9f
chore(tooltip cypress tests): remove "require" statements
Mohammer5 Apr 23, 2024
c62e1ab
chore(gitignore): ignore "cypress/downloads"
Mohammer5 Apr 23, 2024
64ababd
chore(transfer feature step implementation): fix typo
Mohammer5 Apr 23, 2024
6e9f180
chore(transfer reorder feature): use ".as" with static value correctly
Mohammer5 Apr 23, 2024
3bb8b98
chore(cypress config): remove "video" option and renove config cli op…
Mohammer5 Apr 23, 2024
f444c08
chore(package json): move dev dependencies from "dependencies" to "de…
Mohammer5 Apr 23, 2024
af2cbb3
chore(package json): remove superfluous information
Mohammer5 Apr 24, 2024
740ff8e
chore(tooltip cypress steps): remove commented-out code
Mohammer5 Apr 24, 2024
022154d
chore(cucumber step config): remove superfluous "async"
Mohammer5 Apr 25, 2024
495c869
chore(cypress): fix ResizeObserver loop error handling and make it gl…
Mohammer5 Apr 25, 2024
e1d1c1e
chore: fix linter issues
Mohammer5 Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .cypress-cucumber-preprocessorrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"nonGlobalStepDefinitions": true,
"e2e": {
"stepDefinitions": [
"[filepath]/*.{js,mjs,ts,tsx}",
"[filepath]/../common/index.{js,mjs,ts,tsx}",
"cypress/e2e/common.js"
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/dhis2-preview-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile

- run: yarn build
- run: yarn build:legacy
Mohammer5 marked this conversation as resolved.
Show resolved Hide resolved

- name: Deploy
id: netlify-deploy
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/dhis2-verify-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x

- uses: c-hive/gha-yarn-cache@v1
- run: |
yarn install --frozen-lockfile
yarn setup
NODE_OPTIONS=--openssl-legacy-provider yarn setup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be more consistent to add NODE_OPTIONS=--openssl-legacy-provider as a an env variable applying to all the steps? and we get rid of it, once webpack/storybook is upgraded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above


- name: Build
run: yarn build
run: NODE_OPTIONS=--openssl-legacy-provider yarn build

- run: ./scripts/create-artifact.sh

Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x

- uses: actions/download-artifact@v2
with:
Expand All @@ -67,7 +67,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x

- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x

- uses: actions/download-artifact@v2
with:
Expand All @@ -109,10 +109,10 @@ jobs:
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: End-to-End tests
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v6
with:
# This should be a command that starts the server to test against.
start: 'yarn cy:start'
start: 'yarn cy:start:legacy'
wait-on: 'http://localhost:5000'
wait-on-timeout: 300
record: true
Expand All @@ -136,7 +136,7 @@ jobs:
token: ${{env.GH_TOKEN}}
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 20.x
cache: 'yarn'

- uses: actions/download-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bundle.stats.json

# cypress
cypress/screenshots
cypress/downloads
cypress/videos
cypress.env.json

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v20
4 changes: 2 additions & 2 deletions collections/forms/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-02-12T14:58:56.792Z\n"
"PO-Revision-Date: 2024-02-12T14:58:56.792Z\n"
"POT-Creation-Date: 2024-04-18T04:00:14.144Z\n"
"PO-Revision-Date: 2024-04-18T04:00:14.144Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('an unchecked Checkbox without value is rendered', () => {
cy.visitStory('Testing:Checkbox', 'Unchecked')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('an unchecked Checkbox with a value is rendered', () => {
cy.visitStory('Testing:Checkbox', 'Unchecked with value')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { When } from 'cypress-cucumber-preprocessor/steps'
import { When } from '@badeball/cypress-cucumber-preprocessor'

When('the user clicks on the Checkbox', () => {
cy.get('[data-test="dhis2-uicore-checkbox"]').click()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

Given('an unchecked Checkbox is rendered', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('a multi-file IputField is rendered', () => {
cy.visitStory('Testing:FileInput', 'Standard form')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'
import { Given } from '@badeball/cypress-cucumber-preprocessor'

Given('a single-file FileInput is rendered', () => {
cy.visitStory('Testing:FileInput', 'Standard form')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'

When('a file with the wrong file type is provided', () => {
cy.get('[name="fileTxt"]').uploadSingleFile('md', 'FileInput/file.md')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('a Input with no text is rendered', () => {
cy.visitStory('Testing:InputFieldFF', 'Default')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

Given('an empty, required Input is rendered', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('the MultiSelect has two options', () => {
const options = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'
import { Given } from '@badeball/cypress-cucumber-preprocessor'

Given('a required MultiSelect with no selected value', () => {
cy.visitStory('Testing:MultiSelectFieldFF', 'Required')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

When('the user submits the form', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('there are three options', () => {
const options = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'
import { Given } from '@badeball/cypress-cucumber-preprocessor'

Given(
'a FieldGroupFF with required RadioFieldFFs and no selected value',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

When('the user submits the form', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('the SingleSelect has one option', () => {
const options = [{ value: 'Value', label: 'Label' }]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given } from 'cypress-cucumber-preprocessor/steps'
import { Given } from '@badeball/cypress-cucumber-preprocessor'

Given('a required SingleSelect with no selected value', () => {
cy.visitStory('Testing:SingleSelectFieldFF', 'Required')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

When('the user submits the form', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('an unchecked Switch without value is rendered', () => {
cy.visitStory('Testing:SwitchFieldFF', 'Unchecked')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('an unchecked Switch with a value is rendered', () => {
cy.visitStory('Testing:SwitchFieldFF', 'Unchecked with value')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { When } from 'cypress-cucumber-preprocessor/steps'
import { When } from '@badeball/cypress-cucumber-preprocessor'

When('the user clicks on the Switch', () => {
cy.get('[data-test="dhis2-uicore-switch"]').click()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

Given('an unchecked Switch is rendered', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('a TextArea with no text is rendered', () => {
cy.visitStory('TextArea', 'Default')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { hasValueMessage } from '../../../validators/hasValue.js'

Given('an empty, required TextArea is rendered', () => {
Expand Down
18 changes: 0 additions & 18 deletions components/alert/src/alert-bar/features/api/hidden_callback.js

This file was deleted.

8 changes: 6 additions & 2 deletions components/alert/src/alert-bar/features/api/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../common/index.js'
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('an AlertBar with onHidden handler is rendered', () => {
cy.visitStory('AlertBar', 'With onHidden')
Expand All @@ -22,6 +21,11 @@ Given('an AlertBar with permanent is rendered', () => {
cy.get('[data-test="dhis2-uicore-alertbar"]').should('be.visible')
})

When('the Alertbar is not rendered', () => {
cy.wait(8000)
cy.get('[data-test="dhis2-uicore-alertbar"]').should('not.exist')
})

Then('the icon will be visible', () => {
cy.get('[data-test="dhis2-uicore-alertbar-icon"]').should('be.visible')
})
Expand Down
47 changes: 0 additions & 47 deletions components/alert/src/alert-bar/features/api/prop_message.js

This file was deleted.

12 changes: 0 additions & 12 deletions components/alert/src/alert-bar/features/api/props_message.js

This file was deleted.

11 changes: 0 additions & 11 deletions components/alert/src/alert-bar/features/api/props_permanent.js

This file was deleted.

2 changes: 1 addition & 1 deletion components/alert/src/alert-bar/features/common/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { When, Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { When, Given, Then } from '@badeball/cypress-cucumber-preprocessor'

Given('a default AlertBar is rendered', () => {
cy.visitStory('AlertBar', 'Default')
Expand Down
Loading
Loading