-
Notifications
You must be signed in to change notification settings - Fork 41
test: implement ATS tests for PayPal #549
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
ab13bda
e4c816a
021ac20
ad5b385
955c50b
22591b3
6cdf203
e4527df
d66dbf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # EXAMPLE USAGE: | ||
| # | ||
| # Refer for explanation to following link: | ||
| # https://lefthook.dev/configuration/ | ||
| # | ||
| # pre-push: | ||
| # jobs: | ||
| # - name: packages audit | ||
| # tags: | ||
| # - frontend | ||
| # - security | ||
| # run: yarn audit | ||
| # | ||
| # - name: gems audit | ||
| # tags: | ||
| # - backend | ||
| # - security | ||
| # run: bundle audit | ||
| # | ||
| # pre-commit: | ||
| # parallel: true | ||
| # jobs: | ||
| # - run: yarn eslint {staged_files} | ||
| # glob: "*.{js,ts,jsx,tsx}" | ||
| # | ||
| # - name: rubocop | ||
| # glob: "*.rb" | ||
| # exclude: | ||
| # - config/application.rb | ||
| # - config/routes.rb | ||
| # run: bundle exec rubocop --force-exclusion {all_files} | ||
| # | ||
| # - name: govet | ||
| # files: git ls-files -m | ||
| # glob: "*.go" | ||
| # run: go vet {files} | ||
| # | ||
| # - script: "hello.js" | ||
| # runner: node | ||
| # | ||
| # - script: "hello.go" | ||
| # runner: go run | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "semi": true, | ||
| "trailingComma": "es5", | ||
| "printWidth": 180, | ||
| "tabWidth": 4, | ||
| "ignorePatterns": ["node_modules/", "test-results/", "playwright-report", "summary.json"] | ||
| } |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure oxlint is nett, but what was the problem with the ESLint setup? Last time I checked ESLint was working fine and type checking and references were working in VS Code 🤔 I'm not as familiar with oxlint as with eslint and cannot tell if the feature compatibility is complete - as all other projects using the test suite (e.g. platform) haven't migrated, I would prefer also not migrating in SwagPayPal due to maintenance overhead |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": [], | ||
| "env": { | ||
| "builtin": true | ||
| }, | ||
| "ignorePatterns": ["**/eslint.config.*", "test-results/"], | ||
| "rules": { | ||
| "constructor-super": "error", | ||
| "for-direction": "error", | ||
| "no-async-promise-executor": "error", | ||
| "no-case-declarations": "error", | ||
| "no-class-assign": "error", | ||
| "no-compare-neg-zero": "error", | ||
| "no-cond-assign": "error", | ||
| "no-const-assign": "error", | ||
| "no-constant-binary-expression": "error", | ||
| "no-constant-condition": "error", | ||
| "no-control-regex": "error", | ||
| "no-debugger": "error", | ||
| "no-delete-var": "error", | ||
| "no-dupe-class-members": "error", | ||
| "no-dupe-else-if": "error", | ||
| "no-dupe-keys": "error", | ||
| "no-duplicate-case": "error", | ||
| "no-empty": "error", | ||
| "no-empty-character-class": "error", | ||
| "no-empty-pattern": "error", | ||
| "no-empty-static-block": "error", | ||
| "no-ex-assign": "error", | ||
| "no-extra-boolean-cast": "error", | ||
| "no-fallthrough": "error", | ||
| "no-func-assign": "error", | ||
| "no-global-assign": "error", | ||
| "no-import-assign": "error", | ||
| "no-invalid-regexp": "error", | ||
| "no-irregular-whitespace": "error", | ||
| "no-loss-of-precision": "error", | ||
| "no-new-native-nonconstructor": "error", | ||
| "no-nonoctal-decimal-escape": "error", | ||
| "no-obj-calls": "error", | ||
| "no-prototype-builtins": "error", | ||
| "no-redeclare": "error", | ||
| "no-regex-spaces": "error", | ||
| "no-self-assign": "error", | ||
| "no-setter-return": "error", | ||
| "no-shadow-restricted-names": "error", | ||
| "no-sparse-arrays": "error", | ||
| "no-this-before-super": "error", | ||
| "no-unexpected-multiline": "error", | ||
| "no-unsafe-finally": "error", | ||
| "no-unsafe-negation": "error", | ||
| "no-unsafe-optional-chaining": "error", | ||
| "no-unused-labels": "error", | ||
| "no-unused-private-class-members": "error", | ||
| "no-unused-vars": "error", | ||
| "no-useless-backreference": "error", | ||
| "no-useless-catch": "error", | ||
| "no-useless-escape": "error", | ||
| "no-with": "error", | ||
| "require-yield": "error", | ||
| "use-isnan": "error", | ||
| "valid-typeof": "error" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.{js,jsx,ts,tsx}"], | ||
| "rules": { | ||
| "no-unused-vars": "warn", | ||
| "no-console": [ | ||
| "error", | ||
| { | ||
| "allow": ["warn", "error"] | ||
| } | ||
| ] | ||
| }, | ||
| "plugins": ["typescript"] | ||
| }, | ||
| { | ||
| "files": ["tests/**", "**/*.{spec,test}.{js,jsx,ts,tsx}"], | ||
| "rules": { | ||
| "no-empty-pattern": "off", | ||
| "playwright/expect-expect": "off", | ||
| "playwright/max-nested-describe": "warn", | ||
| "playwright/missing-playwright-await": "error", | ||
| "playwright/no-conditional-expect": "off", | ||
| "playwright/no-conditional-in-test": "off", | ||
| "playwright/no-element-handle": "warn", | ||
| "playwright/no-eval": "warn", | ||
| "playwright/no-focused-test": "error", | ||
| "playwright/no-force-option": "warn", | ||
| "playwright/no-nested-step": "warn", | ||
| "playwright/no-networkidle": "error", | ||
| "playwright/no-page-pause": "warn", | ||
| "playwright/no-skipped-test": [ | ||
| "warn", | ||
| { | ||
| "allowConditional": true | ||
| } | ||
| ], | ||
| "playwright/no-standalone-expect": "off", | ||
| "playwright/no-unsafe-references": "error", | ||
| "playwright/no-unused-locators": "error", | ||
| "playwright/no-useless-await": "warn", | ||
| "playwright/no-useless-not": "warn", | ||
| "playwright/no-wait-for-navigation": "error", | ||
| "playwright/no-wait-for-selector": "warn", | ||
| "playwright/no-wait-for-timeout": "warn", | ||
| "playwright/prefer-web-first-assertions": "error", | ||
| "playwright/valid-describe-callback": "error", | ||
| "playwright/valid-expect": "error", | ||
| "playwright/valid-expect-in-promise": "error", | ||
| "playwright/valid-test-tags": "error", | ||
| "playwright/valid-title": "error" | ||
| }, | ||
| "jsPlugins": ["eslint-plugin-playwright"], | ||
| "env": { | ||
| "shared-node-browser": true | ||
| } | ||
| }, | ||
| { | ||
| "files": ["tests/**", "**/*.{spec,test}.{js,jsx,ts,tsx}"], | ||
| "jsPlugins": ["eslint-plugin-playwright"] | ||
| }, | ||
| { | ||
| "files": ["fixtures/**/*.ts", "data-fixtures/**/*.ts", "services/**/*.ts"], | ||
| "rules": { | ||
| "no-empty-pattern": "off" | ||
| } | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { test as base } from '@playwright/test'; | ||
| import { PayPalTestDataService } from '../services/PayPalTestDataService'; | ||
| import { FixtureTypes } from './AcceptanceTest'; | ||
|
|
||
| export interface CommercialTestDataFixtureTypes { | ||
| TestDataService: PayPalTestDataService; | ||
| } | ||
|
|
||
| export const test = base.extend<FixtureTypes & CommercialTestDataFixtureTypes>({ | ||
|
|
||
| TestDataService: async ({ AdminApiContext, IdProvider, DefaultSalesChannel, SalesChannelBaseConfig }, use) => { | ||
| const DataService = new PayPalTestDataService(AdminApiContext, IdProvider, { | ||
| defaultSalesChannel: DefaultSalesChannel.salesChannel, | ||
| defaultTaxId: SalesChannelBaseConfig.taxId, | ||
| defaultCurrencyId: SalesChannelBaseConfig.defaultCurrencyId, | ||
| defaultCategoryId: DefaultSalesChannel.salesChannel.navigationCategoryId, | ||
| defaultLanguageId: DefaultSalesChannel.salesChannel.languageId, | ||
| defaultCountryId: DefaultSalesChannel.salesChannel.countryId, | ||
| defaultCustomerGroupId: DefaultSalesChannel.salesChannel.customerGroupId, | ||
| }); | ||
|
|
||
| await use(DataService); | ||
|
|
||
| // PayPal specific cleanup | ||
| await DataService.cleanUpPayPalEntities(); | ||
|
|
||
| // General cleanup | ||
| await DataService.cleanUp(); | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I don't know. It was added in ATS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not needed