diff --git a/.github/workflows/playwrightTests.yml b/.github/workflows/playwrightTests.yml new file mode 100644 index 0000000..97898b9 --- /dev/null +++ b/.github/workflows/playwrightTests.yml @@ -0,0 +1,16 @@ +name: Playwright Tests +on: [pull_request] +jobs: + playwright: + name: "Playwright e2e Tests" + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/playwright:v1.43.0-jammy + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18 + - run: yarn install + - run: yarn build + - run: yarn test:e2e:ci diff --git a/@stellar/typescript-wallet-sdk/jest.e2e.config.js b/@stellar/typescript-wallet-sdk/jest.e2e.config.js new file mode 100644 index 0000000..ea8b056 --- /dev/null +++ b/@stellar/typescript-wallet-sdk/jest.e2e.config.js @@ -0,0 +1,9 @@ +module.exports = { + rootDir: "./", + preset: "ts-jest", + transform: { + "^.+\\.(ts|tsx)?$": "ts-jest", + "^.+\\.(js|jsx)$": "babel-jest", + }, + testMatch: ["**/e2e/*.test.ts"], +}; diff --git a/@stellar/typescript-wallet-sdk/package.json b/@stellar/typescript-wallet-sdk/package.json index 154bd6b..d9b7a36 100644 --- a/@stellar/typescript-wallet-sdk/package.json +++ b/@stellar/typescript-wallet-sdk/package.json @@ -62,6 +62,7 @@ "scripts": { "test": "jest --watchAll", "test:ci": "jest --ci", + "test:e2e:ci": "jest --config jest.e2e.config.js --ci", "test:recovery:ci": "jest --config jest.integration.config.js recovery.test.ts --ci", "test:anchorplatform:ci": "yarn jest --config jest.integration.config.js anchorplatform.test.ts --ci", "build:web": "webpack --config webpack.config.js", diff --git a/jest.config.js b/jest.config.js index 9d3582e..94b2794 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,7 +9,7 @@ module.exports = { { displayName: "Wallet SDK", roots: ["./@stellar/typescript-wallet-sdk"], - testPathIgnorePatterns: ["/node_modules/", "/integration/"], + testPathIgnorePatterns: ["/node_modules/", "/integration/", "/e2e/"], ...commonConfigs, }, { diff --git a/package.json b/package.json index b2834ba..12fef58 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint": "eslint . --ext .ts", "test": "jest --watchAll", "test:ci": "jest --ci", + "test:e2e:ci": "yarn workspace @stellar/typescript-wallet-sdk test:e2e:ci", "test:recovery:ci": "yarn workspace @stellar/typescript-wallet-sdk test:recovery:ci", "test:anchorplatform:ci": "yarn workspace @stellar/typescript-wallet-sdk test:anchorplatform:ci", "build": "yarn workspace @stellar/typescript-wallet-sdk build && yarn workspace @stellar/typescript-wallet-sdk-km build && yarn workspace @stellar/typescript-wallet-sdk-soroban build"