|
@@ -14,13 +14,16 @@ module.exports = async () => {
|
|
|
// this global is only available in the teardown but not in TestEnvironments
|
|
|
global.__BROWSER_GLOBAL__ = browser;
|
|
|
|
|
|
+ // Make sure this matches the origin defined in PuppeteerEnvironment.js.
|
|
|
+ const testOrigin = process.env.TEST_ORIGIN ?? 'http://localhost:8000';
|
|
|
+
|
|
|
// use the file system to expose the wsEndpoint for TestEnvironments
|
|
|
await mkdir(DIR, { recursive: true });
|
|
|
await writeFile(path.join(DIR, 'wsEndpoint'), browser.wsEndpoint());
|
|
|
|
|
|
// Automatically log into the Wagtail admin.
|
|
|
const page = await browser.newPage();
|
|
|
- await page.goto('http://localhost:8000/admin/login/');
|
|
|
+ await page.goto(`${testOrigin}/admin/login/`);
|
|
|
await page.type('#id_username', 'admin');
|
|
|
await page.type('#id_password', 'changeme');
|
|
|
await Promise.all([
|