Skip to content

Commit

Permalink
test(pd): enable parameters for steps (#17442)
Browse files Browse the repository at this point in the history
  • Loading branch information
y3rsh authored Feb 12, 2025
1 parent d57e910 commit 3ad2cae
Show file tree
Hide file tree
Showing 27 changed files with 1,294 additions and 1,025 deletions.
40 changes: 19 additions & 21 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: 2.0

coverage:
status:
project:
Expand All @@ -15,25 +13,25 @@ comment:
layout: 'reach, diff, flags, files'

ignore:
- 'webpack-config/**'
- 'hardware-testing/**'
- 'abr-testing/**'
- 'test-data-generation/**'
- 'performance-metrics/**'
- 'package-testing/**'
- 'opentrons-ai-server/**'
- 'opentrons-ai-client/**'
- 'g-code-testing/**'
- 'api-client/**'
- 'analyses-snapshot-testing/**'
- '.storybook/**'
- 'react-api-client/**'
- 'scripts/**'
- '.github/**'
- '**/build/**'
- '**/dist/**'
- '**/node_modules/**'
- '**/{test,tests,__tests__,__mocks__,mocks}/**'
- 'hardware-testing/**/*'
- 'abr-testing/**/*'
- 'test-data-generation/**/*'
- 'performance-metrics/**/*'
- 'package-testing/**/*'
- 'opentrons-ai-server/**/*'
- 'opentrons-ai-client/**/*'
- 'g-code-testing/**/*'
- 'api-client/**/*'
- 'analyses-snapshot-testing/**/*'
- '.storybook/**/*'
- 'react-api-client/**/*'
- 'scripts/**/*'
- '.github/**/*'
- '**/build/**/*'
- '**/dist/**/*'
- '**/node_modules/**/*'
- '**/cypress/**/*'
- '**/{test,tests,__tests__,__mocks__,mocks}/**/*'
- '**/*.{md,yaml,yml,json,rst}'
- '**/Makefile'
- '**/*.{in,ini,lock,toml,cfg}'
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,7 @@ test-js-internal:
.PHONY: test-js-%
test-js-%:
$(MAKE) test-js-internal tests="$(if $(tests),$(foreach test,$(tests),$*/$(test)),$*)" test_opts="$(test_opts)" cov_opts="$(cov_opts)"

.PHONY: validate-codecov-yml
validate-codecov-yml:
curl --data-binary @.codecov.yml https://codecov.io/validate
18 changes: 11 additions & 7 deletions protocol-designer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ test:
test-cov:
make -C .. test-js-protocol-designer tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"

CYPRESS_ESLINT_GLOB := "cypress/**/*.{js,ts,tsx}"
CYPRESS_PRETTIER_GLOB := "cypress/**/*.{js,ts,tsx,md,json}"
CYPRESS_ESLINT_GLOB := cypress/**/*.ts cypress.config.ts
CYPRESS_PRETTIER_GLOB := cypress/**/*.{ts,md,json} cypress.config.ts

.PHONY: cy-lint-check
cy-lint-check: cy-lint-eslint-check cy-lint-prettier-check
Expand All @@ -84,22 +84,22 @@ cy-lint-fix: cy-lint-eslint-fix cy-lint-prettier-fix
@echo "Cypress lint fix applied."

.PHONY: cy-lint-eslint-check
cy-lint-eslint-check:
cy-lint-eslint-check: clean-downloads clean-screenshots
yarn eslint --ignore-path ../.eslintignore $(CYPRESS_ESLINT_GLOB)
@echo "Cypress ESLint check completed."

.PHONY: cy-lint-eslint-fix
cy-lint-eslint-fix:
cy-lint-eslint-fix: clean-downloads clean-screenshots
yarn eslint --fix --ignore-pattern ../.eslintignore $(CYPRESS_ESLINT_GLOB)
@echo "Cypress ESLint fix applied."

.PHONY: cy-lint-prettier-check
cy-lint-prettier-check:
cy-lint-prettier-check: clean-downloads clean-screenshots
yarn prettier --ignore-path ../.eslintignore --check $(CYPRESS_PRETTIER_GLOB)
@echo "Cypress Prettier check completed."

.PHONY: cy-lint-prettier-fix
cy-lint-prettier-fix:
cy-lint-prettier-fix: clean-downloads clean-screenshots
yarn prettier --ignore-path ../.eslintignore --write $(CYPRESS_PRETTIER_GLOB)
@echo "Cypress Prettier fix applied."

Expand All @@ -111,4 +111,8 @@ cy-ui:

.PHONY: clean-downloads
clean-downloads:
shx rm -rf cypress/downloads
shx rm -rf cypress/downloads

.PHONY: clean-screenshots
clean-screenshots:
shx rm -rf cypress/screenshots
99 changes: 0 additions & 99 deletions protocol-designer/cypress/e2e/ProtocolDesignerModulesTest.cy.ts

This file was deleted.

58 changes: 25 additions & 33 deletions protocol-designer/cypress/e2e/createNew.cy.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
import { UniversalActions } from '../support/universalActions'
import '../support/commands'
// Every test is goign to use StepsList
// Now every test will be a list of some combination of support
// typescript file list of actions for specific PD stuff and include StepsList for steps

import { runSteps } from '../support/StepExecution'
import type { StepsList } from '../support/StepExecution'
import { UniversalSteps } from '../support/UniversalSteps'
import { SetupSteps, SetupVerifications } from '../support/SetupSteps'
import { StepBuilder } from '../support/StepBuilder'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
Expand All @@ -17,29 +11,27 @@ describe('The Redesigned Create Protocol Landing Page', () => {
it('content and step 1 flow works', () => {
cy.verifyCreateNewHeader()
cy.clickCreateNew()
const steps: StepsList = [
SetupVerifications.OnStep1,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
SetupActions.SelectOT2,
SetupVerifications.OT2Selected,
UniversalActions.Snapshot,
SetupActions.SelectFlex,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupVerifications.NinetySixChannel,
UniversalActions.Snapshot,
SetupActions.GoBack,
SetupVerifications.OnStep1,
SetupActions.SelectOT2,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupVerifications.NotNinetySixChannel,
UniversalActions.Snapshot,
]

runSteps(steps)
const steps: StepBuilder = new StepBuilder()
steps.add(SetupVerifications.OnStep1())
steps.add(SetupVerifications.FlexSelected())
steps.add(UniversalSteps.Snapshot())
steps.add(SetupSteps.SelectOT2())
steps.add(SetupVerifications.OT2Selected())
steps.add(UniversalSteps.Snapshot())
steps.add(SetupSteps.SelectFlex())
steps.add(SetupVerifications.FlexSelected())
steps.add(UniversalSteps.Snapshot())
steps.add(SetupSteps.Confirm())
steps.add(SetupVerifications.OnStep2())
steps.add(SetupVerifications.NinetySixChannel())
steps.add(UniversalSteps.Snapshot())
steps.add(SetupSteps.GoBack())
steps.add(SetupVerifications.OnStep1())
steps.add(SetupSteps.SelectOT2())
steps.add(SetupSteps.Confirm())
steps.add(SetupVerifications.OnStep2())
steps.add(SetupVerifications.NotNinetySixChannel())
steps.add(UniversalSteps.Snapshot())
steps.execute()
})
})
Loading

0 comments on commit 3ad2cae

Please sign in to comment.