The main problem I have here, is that when I launch my tests, the window that selenium web-driver opens, is a small window.
In my tests I ask selenium to click on an element, but this element depends on the size of the browser, it hides in a menu. So I would like to know how I could make the browser open completely for all the tests.
And need to change the size so that it opens the whole browser. But I would like to add the code here:
import { After, AfterAll, Status } from '@cucumber/cucumber';
import { Builder, Capabilities } from 'selenium-webdriver';
require('chromedriver');
// driver setup
const capabilities = Capabilities.chrome();
capabilities.set('chromeOptions', { w3c: false });
export const driver = new Builder().withCapabilities(capabilities).build();
After(function (scenario) {
if (scenario.result.status === Status.FAILED) {
return driver.takeScreenshot().then(screenShot => {
this.attach(screenShot, 'image/png');
});
}
});
AfterAll(async () => await driver.quit());