const searchValue = await page.$eval('#search', el => el.value);
const searchValue = await page.$eval('[name="searchTxt"]', el => el.value);
qawolf.launch({ args: ['--start-fullscreen'] });
getComputedStyle
API here https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
const color = await page.evaluate(() => {
const videoIcon = document.querySelector( '//span[text()=\'videocam\']');
const videoIconStyles = window.getComputedStyle(videoIcon);
return videoIconStyles.getPropertyValue('color');
});
color
in CSS means font color, which may not be what you want. It may be background-color
, fill
, or stroke
.
videoIcon
is not an element, so perhaps document.querySelector
is returning null
here if the element is not found
const searchValue = await page.$eval('#myId', el => el.value);
QAW_ARTIFACT_PATH=/tmp/testArtifacts/ DEBUG=pw:api BASE_URL=<my_url> yarn qawolf test absoluteDaysSaveCorrectly