Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FTR] Switch to new browser headless mode #153828

Merged
merged 16 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

if (canReadClipboard) {
const copiedSourceData = await browser.getClipboardValue();
expect(copiedSourceData.startsWith('"_source"\n{"@message":["238.171.34.42')).to.be(true);
expect(copiedSourceData.startsWith('Document\n{"@message":["238.171.34.42')).to.be(true);
expect(copiedSourceData.endsWith('}')).to.be(true);
}

Expand All @@ -89,7 +89,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

if (canReadClipboard) {
const copiedSourceName = await browser.getClipboardValue();
expect(copiedSourceName).to.be('"_source"');
expect(copiedSourceName).to.be('Document');
}

expect(await toasts.getToastCount()).to.be(1);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/discover/group2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {

describe('discover/group2', function () {
before(async function () {
await browser.setWindowSize(1300, 800);
await browser.setWindowSize(1600, 1200);
});

after(async function unloadMakelogs() {
Expand Down
Binary file modified test/functional/screenshots/baseline/area_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions test/functional/services/remote/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean
}

if (headlessBrowser === '1') {
// Using the new headless mode (instead of `options.headless()`)
// See: https://www.selenium.dev/blog/2023/headless-is-going-away/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart adding the link in the comment! 🎉

options.addArguments('headless=new');

// Use --disable-gpu to avoid an error from a missing Mesa library, as per
// See: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
options.headless();
options.addArguments('disable-gpu');
}

Expand All @@ -111,7 +114,11 @@ function initChromiumOptions(browserType: Browsers, acceptInsecureCerts: boolean

if (remoteDebug === '1') {
// Visit chrome://inspect in chrome to remotely view/debug
options.headless();

// Using the new headless mode (instead of `options.headless()`)
// See: https://www.selenium.dev/blog/2023/headless-is-going-away/
options.addArguments('headless=new');

options.addArguments('disable-gpu', 'remote-debugging-port=9222');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function ({ getPageObjects, getService }) {
it('should request clusters when zoomed to larger regions showing lots of data', async () => {
await PageObjects.maps.setView(20, -90, 2);
const { rawResponse: response } = await PageObjects.maps.getResponse();
expect(response.aggregations.gridSplit.buckets.length).to.equal(17);
expect(response.aggregations.gridSplit.buckets.length).to.equal(15);
});

it('should request documents when query narrows data', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function ({ getPageObjects, getService }) {
const { lat, lon, zoom } = await PageObjects.maps.getView();
expect(Math.round(lat)).to.equal(43);
expect(Math.round(lon)).to.equal(-102);
expect(Math.round(zoom)).to.equal(5);
pheyos marked this conversation as resolved.
Show resolved Hide resolved
expect(Math.round(zoom)).to.equal(4);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ({ getPageObjects, getService }) {
});

it('should not rerequest when pan changes do not move map view area outside of buffer', async () => {
await PageObjects.maps.setView(DATA_CENTER_LAT + 10, DATA_CENTER_LON + 10, 1);
pheyos marked this conversation as resolved.
Show resolved Hide resolved
await PageObjects.maps.setView(DATA_CENTER_LAT + 5, DATA_CENTER_LON + 5, 1);
const afterTimestamp = await getRequestTimestamp();
expect(afterTimestamp).to.equal(beforeTimestamp);
});
Expand Down
Binary file modified x-pack/test/functional/screenshots/baseline/flights_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified x-pack/test/functional/screenshots/baseline/web_logs_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.