PP
Size: a a a
PP
SC
OK
PP
G
G
contains в итоге фигачит)OK
G
OK
OI
OI
OK
SC
async isVisible(): Promise<boolean> {
try {
await this.waitForVisible();
}
catch (e) {
if (e.name !== "TimeoutError") {
throw e;
}
return false;
}
return true;
}
async waitForVisible(): Promise<void> {
return page.waitForXPath(
this.selector,
{
timeout: 4000,
visible: true,
},
);
}PP
PP
SC
SC
VB
export const elementIsPresentByXpath = async (selectorXpath, timeForWait) => {
let millisecondsForWait = timeForWait;
if (typeof millisecondsForWait === 'undefined') {
millisecondsForWait = 5000;
}
try {
await page.waitForXPath(selectorXpath, { timeout: millisecondsForWait });
return true;
} catch (e) {
console.warn(`Element by Xpath not found: ${selectorXpath}`);
return false;
}
}OK
export const elementIsPresentByXpath = async (selectorXpath, timeForWait) => {
let millisecondsForWait = timeForWait;
if (typeof millisecondsForWait === 'undefined') {
millisecondsForWait = 5000;
}
try {
await page.waitForXPath(selectorXpath, { timeout: millisecondsForWait });
return true;
} catch (e) {
console.warn(`Element by Xpath not found: ${selectorXpath}`);
return false;
}
}OK
export const elementIsPresentByXpath = async (selectorXpath, timeForWait) => {
let millisecondsForWait = timeForWait;
if (typeof millisecondsForWait === 'undefined') {
millisecondsForWait = 5000;
}
try {
await page.waitForXPath(selectorXpath, { timeout: millisecondsForWait });
return true;
} catch (e) {
console.warn(`Element by Xpath not found: ${selectorXpath}`);
return false;
}
}