#926 Adding e2e tools for replicating issues

This commit is contained in:
knsv
2019-09-08 00:33:38 -07:00
parent 21aa8c5f15
commit 65561b22c5
3 changed files with 52 additions and 1 deletions

22
.tern-project Normal file
View File

@@ -0,0 +1,22 @@
{
"ecmaVersion": 6,
"libs": [
"browser"
],
"loadEagerly": [
"path/to/your/js/**/*.js"
],
"dontLoad": [
"node_modules/**",
"path/to/your/js/**/*.js"
],
"plugins": {
"modules": {},
"es_modules": {},
"node": {},
"doc_comment": {
"fullDocs": true,
"strong": true
}
}
}

View File

@@ -7,3 +7,28 @@ Apart from beeing rendered in a browser the tests perform image snapshots of the
## To run the tests
1. Start the dev server by running ***yarn dev***
2. Run yarn e2e to run the tests
## Recomended way of working
If you are working with an issue you wanto to fix. Start with making a e2e test that show the issue.
Add otions for the e2e tests to log the dev server url as in the example below.
```
await imgSnapshotTest(page, `
graph LR
foo-->bar
style foo fill:#F99,stroke-width:2px,stroke:#F0F
style bar fill:#999,color: #ffffff, stroke-width:10px,stroke:#0F0
`,
{
listUrl: true,
listId: 'color'
logLevel: 0
})
```
Open the url in the dev server and fix the issue.
This way if working makes it easy to have render a graph you want to work with ands ensures that the e2e suit is expanded.

View File

@@ -12,6 +12,10 @@ export const mermaidUrl = (graphStr, options, api) => {
url = 'http://localhost:9000/xss.html?graph=' + graphStr
}
if (options.listUrl) {
console.log(options.listId, ' ', url)
}
return url
}