-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Tested against: dbede12
It seems that the array does not start at index 0, and instead starts at index 1. In PW it correctly starts at 0. I think there's an underlying issue which is causing that should be fixed.
NOTE: In the code below it works against localhost:8080
, which is a test server. It can be found in the following link along with Instructions on how to run it locally: https://github.com/ankur22/testserver.
Script:
import { sleep } from 'k6';
import launcher from 'k6/x/browser';
export default function () {
const browser = launcher.launch('chromium', {
headless: false,
});
const context = browser.newContext();
context.newPage();
const pages = context.pages();
const res = pages[0].goto('http://localhost:8080/unprotected');
sleep(10);
browser.close();
}
PW script:
// @ts-check
const { test, chromium } = require('@playwright/test');
test.describe('Editing', () => {
test('Type login creds', async () => {
const browser = await chromium.launch({ headless: false, slowMo: 500 });
const ctx = await browser.newContext();
await ctx.newPage();
const pages = ctx.pages();
await pages[0].goto('http://localhost:8080/unprotected');
await new Promise(resolve => setTimeout(resolve, 10000));
await browser.close();
});
});