You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I provided exact source code that allows reproducing the issue locally.
Config file
// playwright.config.tsconstconfig: PlaywrightTestConfig={testDir: '.',/* Maximum time one test can run for. */timeout: 300*1000,expect: {/** * Maximum time expect() should wait for the condition to be met. * For example in `await expect(locator).toHaveText();` */timeout: 5*1000,},/* Run tests in files in parallel */fullyParallel: true,/* Fail the build on CI if you accidentally left test.only in the source code. */forbidOnly: !!process.env.CI,retries: 0,/* Opt out of parallel tests on CI. */workers: process.env.CI ? 1 : undefined,/* Reporter to use. See https://playwright.dev/docs/test-reporters */reporter: 'html',globalSetup: require.resolve('./lib/global-setup'),/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */use: {headless: false,// channel: 'msedge',/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */actionTimeout: 0,/* Base URL to use in actions like `await page.goto('/')`. */baseURL: process.env.CI ? process.env.TEST_SERVER_URL : 'http://localhost:3000',/* Use data-qa as the default test-id attribute */testIdAttribute: 'data-qa',/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */trace: 'on',// This is not read when projects section is defined. Ref: https://github.com/microsoft/playwright/issues/16077userAgent: customUserAgent,},/* Folder for test artifacts such as screenshots, videos, traces, etc. */outputDir: 'test-results/',};
Test file (self-contained)
awaittest.step('Navigate to url.',async()=>{awaitpage.goto('https://some.url',);});
Steps
Run playwright test that opens browser and navigates to a specific page.
Expected
Page html should have following script:
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
Actual
Page is missing the expected javascript. So we get error:
Uncaught ReferenceError: __doPostBack is not defined
at HTMLButtonElement.onclick
This only happens in the browser that is opened by playwright. Wanted to see if there is some setting I'm missing.
The text was updated successfully, but these errors were encountered:
System info
Source code
Config file
Test file (self-contained)
Steps
Expected
Page html should have following script:
Actual
Page is missing the expected javascript. So we get error:
This only happens in the browser that is opened by playwright. Wanted to see if there is some setting I'm missing.
The text was updated successfully, but these errors were encountered: