Skip to content

Commit

Permalink
chore: add test for
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade authored and OrKoN committed May 2, 2023
1 parent 575f00a commit a6f78d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@
"parameters": ["cdp", "firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[page.spec] Page Page.Events.Console should work on script call right after navigation",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.setContent *",
"platforms": ["darwin", "linux", "win32"],
Expand Down
12 changes: 12 additions & 0 deletions test/src/page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,18 @@ describe('Page', function () {
expect(await message.args()[1]!.jsonValue()).toEqual(5);
expect(await message.args()[2]!.jsonValue()).toEqual({foo: 'bar'});
});
it('should work on script call right after navigation', async () => {
const {page} = getTestState();

const [message] = await Promise.all([
waitEvent<ConsoleMessage>(page, 'console'),
page.goto(
`data:text/html,<script>console.log('SOME_LOG_MESSAGE');</script>`
),
]);

expect(message.text()).toEqual('SOME_LOG_MESSAGE');
});
it('should work for different console API calls with logging functions', async () => {
const {page} = getTestState();

Expand Down

0 comments on commit a6f78d9

Please sign in to comment.