Skip to content

Commit

Permalink
feat: ability to specify "configPath" via vscode settings
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Oct 2, 2024
1 parent 0589939 commit ff07a34
Show file tree
Hide file tree
Showing 20 changed files with 14,821 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_modules
.DS_Store
vscode.d.ts
.eslintcache
samples/**/.*
samples/**/.testplane
.wdio*
.tmp
tests/e2e/**/screens-on-fail
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ Adds a keybinding (`cmd+shift+8` for mac and `ctrl+shift+8` for others) to run a
[testplane]: https://testplane.io/
[testplane-repl-mode]: https://github.com/gemini-testing/testplane/blob/master/docs/cli.md#repl-mode
[vscode-keyboard-shortcuts]: https://code.visualstudio.com/docs/getstarted/keybindings

## Configuration

You can configure Testplane using [user and workspace settings](https://code.visualstudio.com/docs/getstarted/settings#_workspace-settings). Available settings:

- `testplane.configPath`: The path to the Testplane [configuration file](https://testplane.io/docs/v8/config/main/).
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
"name": "Testplane"
}
]
},
"configuration": {
"title": "Testplane",
"properties": {
"testplane.configPath": {
"markdownDescription": "The path to the Testplane [configuration file](https://testplane.io/docs/v8/config/main/)",
"type": "string",
"scope": "window"
}
}
}
},
"repository": {
Expand All @@ -50,9 +60,10 @@
"build": "tsup --minify --clean",
"watch": "tsup --watch --sourcemap",
"test": "npm run lint && npm run test-e2e",
"test-e2e": "npm run test-e2e:basic && npm run test-e2e:settings-view",
"test-e2e": "npm run test-e2e:basic && npm run test-e2e:settings-view && npm run test-e2e:vscode-settings",
"test-e2e:basic": "wdio run ./tests/e2e/basic/wdio.conf.ts",
"test-e2e:settings-view": "wdio run ./tests/e2e/settings-view/wdio.conf.ts",
"test-e2e:vscode-settings": "wdio run ./tests/e2e/vscode-settings/wdio.conf.ts",
"eslint": "eslint src --ext ts --cache",
"lint": "eslint --cache . && prettier --check .",
"reformat": "eslint --fix . && prettier --write .",
Expand Down
3 changes: 3 additions & 0 deletions samples/vscode-settings/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"testplane.configPath": "./another-config/testplane.config.ts"
}
27 changes: 27 additions & 0 deletions samples/vscode-settings/another-config/testplane.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default {
gridUrl: "http://localhost:4444/wd/hub",
baseUrl: "http://localhost",
pageLoadTimeout: 0,
httpTimeout: 60000,
testTimeout: 90000,
resetCursor: false,
takeScreenshotOnFails: {
testFail: false,
assertViewFail: false,
},
sets: {
desktop: {
files: ["tests/**/*.testplane.ts"],
browsers: ["another-bro"],
},
},
browsers: {
"another-bro": {
automationProtocol: "devtools",
headless: true,
desiredCapabilities: {
browserName: "another-bro",
},
},
},
};
Loading

0 comments on commit ff07a34

Please sign in to comment.