Skip to content

Commit

Permalink
[Playwright] Add Playwright Support (#125)
Browse files Browse the repository at this point in the history
Co-authored-by: Logan Graham <logan.graham@saucelabs.com>
  • Loading branch information
omacranger and Logan Graham authored Sep 10, 2024
1 parent 4f358f1 commit 7b1c3cc
Show file tree
Hide file tree
Showing 23 changed files with 3,985 additions and 2,228 deletions.
6 changes: 6 additions & 0 deletions visual-js/.changeset/tall-carpets-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@saucelabs/visual-playwright": minor
"@saucelabs/visual": patch
---

Add playwright support
3 changes: 2 additions & 1 deletion visual-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"visual-storybook",
"visual-wdio",
"visual-cypress",
"visual-nightwatch"
"visual-nightwatch",
"visual-playwright"
],
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": [
Expand Down
35 changes: 35 additions & 0 deletions visual-js/visual-playwright/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'jest.config.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',

// Allow unused vars that start with _
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
},
};
4 changes: 4 additions & 0 deletions visual-js/visual-playwright/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.work
build/
coverage/
.parent/
4 changes: 4 additions & 0 deletions visual-js/visual-playwright/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
76 changes: 76 additions & 0 deletions visual-js/visual-playwright/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "@saucelabs/visual-playwright",
"description": "Playwright Plugin / Bootstrapper for Sauce Labs Visual",
"version": "0.0.0",
"main": "build/index.cjs",
"module": "build/index.js",
"types": "build/index.d.ts",
"license": "MIT",
"files": [
"build"
],
"type": "module",
"engines": {
"node": ">=18"
},
"keywords": [
"saucelabs",
"visual",
"playwright"
],
"exports": {
".": {
"require": "./build/index.cjs",
"import": "./build/index.js",
"types": "./build/index.d.ts"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup-node",
"watch": "tsc-watch --declaration -p .",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\""
},
"dependencies": {
"@playwright/test": "^1.42.1",
"@saucelabs/visual": "^0.7.0",
"exponential-backoff": "^3.1.1"
},
"tsup": {
"entry": [
"./src/index.ts"
],
"dts": true,
"outDir": "./build",
"format": [
"cjs",
"esm"
],
"external": [
"@saucelabs/visual-playwright"
],
"noExternal": []
},
"devDependencies": {
"@jest/globals": "^28.0.0 || ^29.0.0",
"@storybook/types": "^8.0.2",
"@tsconfig/node18": "^2.0.0",
"@types/node": "^18.13.0",
"@types/node-fetch": "^2.6.4",
"@types/selenium-webdriver": "^4.1.15",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.5.0",
"jest-junit-reporter": "^1.1.0",
"prettier": "^2.8.8",
"ts-jest": "^29.1.1",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.1",
"tsc-watch": "^6.0.4",
"tsup": "^7.2.0",
"typescript": "^5.5.4"
}
}
Loading

0 comments on commit 7b1c3cc

Please sign in to comment.