Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# EXAMPLE USAGE:

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?

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

Copy link
Contributor

Choose a reason for hiding this comment

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

its not needed

#
# 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
8 changes: 8 additions & 0 deletions tests/acceptance/.oxfmtrc.json
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"]
}
132 changes: 132 additions & 0 deletions tests/acceptance/.oxlintrc.json
Copy link
Contributor

Choose a reason for hiding this comment

The 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"
}
}
]
}
2 changes: 1 addition & 1 deletion tests/acceptance/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
playwright.configs['flat/recommended'],
stylistic.configs['recommended-flat'],
stylistic.configs['recommended'],
{
languageOptions: {
ecmaVersion: 'latest',
Expand Down
10 changes: 10 additions & 0 deletions tests/acceptance/fixtures/AcceptanceTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import { test as shopAdminTasks } from '@tasks/ShopAdminTasks';
import { test as adminPages } from '@page-objects/AdministrationPages';
import { test as storefrontPages } from '@page-objects/StorefrontPages';
import { test as services } from '@services/Services';
import { test as payPalTestDataService } from '../fixtures/PayPalTestData';
import type { FixtureTypes as BaseTypes } from '@shopware-ag/acceptance-test-suite';
import type { AdminPageTypes } from '../page-objects/AdministrationPages';
import type { StorefrontPageTypes } from '../page-objects/StorefrontPages';
import type { DataFixtureTypes } from '../data-fixtures/DataFixtures';

export * from '@shopware-ag/acceptance-test-suite';

export type FixtureTypes = AdminPageTypes & StorefrontPageTypes & DataFixtureTypes & BaseTypes;

export const test = mergeTests(
ShopwareTestSuite,
Expand All @@ -12,4 +21,5 @@ export const test = mergeTests(
adminPages,
storefrontPages,
services,
payPalTestDataService,
);
30 changes: 30 additions & 0 deletions tests/acceptance/fixtures/PayPalTestData.ts
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();
},
});
Loading