Skip to content

Commit

Permalink
add qawolf.stopVideos() to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jperl committed Mar 11, 2020
1 parent 517c8b7 commit 28e9911
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/build-code/buildTemplate.ts
Expand Up @@ -82,6 +82,7 @@ if (require.main === module) {
${buildNewContext(device)}
await qawolf.register(context);
await ${validName}(context);
await qawolf.stopVideos();
await browser.close();
})();
}`;
Expand All @@ -107,7 +108,10 @@ beforeAll(async () => {
page = await context.newPage();
});
afterAll(() => browser.close());
afterAll(async () => {
await qawolf.stopVideos();
await browser.close();
});
test('${name}', async () => {
await page.goto("${url}");${buildSetState(statePath)}
Expand Down
19 changes: 16 additions & 3 deletions test/build-code/__snapshots__/buildTemplate.test.ts.snap
Expand Up @@ -18,6 +18,7 @@ if (require.main === module) {
const context = await browser.newContext();
await qawolf.register(context);
await myScript(context);
await qawolf.stopVideos();
await browser.close();
})();
}"
Expand All @@ -37,7 +38,10 @@ beforeAll(async () => {
page = await context.newPage();
});
afterAll(() => browser.close());
afterAll(async () => {
await qawolf.stopVideos();
await browser.close();
});
test('myTest', async () => {
await page.goto(\\"www.qawolf.com\\");
Expand All @@ -63,6 +67,7 @@ if (require.main === module) {
const context = await browser.newContext();
await qawolf.register(context);
await myScript(context);
await qawolf.stopVideos();
await browser.close();
})();
}"
Expand Down Expand Up @@ -91,6 +96,7 @@ if (require.main === module) {
});
await qawolf.register(context);
await myScript(context);
await qawolf.stopVideos();
await browser.close();
})();
}"
Expand All @@ -115,7 +121,10 @@ beforeAll(async () => {
page = await context.newPage();
});
afterAll(() => browser.close());
afterAll(async () => {
await qawolf.stopVideos();
await browser.close();
});
test('myTest', async () => {
await page.goto(\\"www.qawolf.com\\");
Expand All @@ -142,6 +151,7 @@ if (require.main === module) {
const context = await browser.newContext();
await qawolf.register(context);
await myScript(context);
await qawolf.stopVideos();
await browser.close();
})();
}"
Expand All @@ -161,7 +171,10 @@ beforeAll(async () => {
page = await context.newPage();
});
afterAll(() => browser.close());
afterAll(async () => {
await qawolf.stopVideos();
await browser.close();
});
test('myTest', async () => {
await page.goto(\\"www.qawolf.com\\");
Expand Down

0 comments on commit 28e9911

Please sign in to comment.