Skip to content

Commit

Permalink
more hacks and perturbations
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronWatters committed May 7, 2020
1 parent b5e9a6f commit 3eb1cd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ <h1>Test page</h1>
};

function get_target_content() {
// hack xxxxx
return "<em>plugin is working</em>";
return window.jQuery('#target').html();
};

Expand Down
5 changes: 3 additions & 2 deletions tests/headless.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ describe("headless browser tests", async () => {
// sleep a second to let the page execute javascript
await sleep(1000);
check_truthy("window.test_function");
await page.waitForFunction(() => !!(window.test_function));
//await page.waitForFunction(() => !!(window.test_function));
await page.waitForFunction(() => !!(window.jQuery));
var content = await page.evaluate(() => window.test_function());
check_truthy("window.test_function");
console.log("function content is: " + content);
Expand Down Expand Up @@ -84,7 +85,7 @@ describe("headless browser tests", async () => {
//check_truthy("window.jQuery('#target')")
//check_truthy("window.jQuery('#target')")
//check_truthy("window.jQuery('#target')")
var content = await page.evaluate(() => window.get_target_content());
var content = await page.evaluate(() => get_target_content());
console.log("target content is: " + content);
var expected_content = "<em>plugin is working</em>";
expect(content).toBe(expected_content);
Expand Down

0 comments on commit 3eb1cd4

Please sign in to comment.