JS automation chat: https://t.me/js_for_testing
Contact me: https://xotabu4.github.io/
import { declareClickCommand } from './customCommands'; | |
export const baseConfig: WebdriverIO.Config = { | |
bail: 0, | |
automationProtocol: 'webdriver', | |
hostname: 'localhost', | |
protocol: 'http', | |
port: 4444, | |
path: '/wd/hub', | |
baseUrl: '', |
JS automation chat: https://t.me/js_for_testing
Contact me: https://xotabu4.github.io/
JS automation chat: https://t.me/js_for_testing
Contact me: https://xotabu4.github.io/
Slides: https://www.slideshare.net/AlexandrKhotemskoy/webdriverio-puppeteer-double-gun-double-fun
// name: Trigger tests for run | |
// description: Triggers automated tests for a test run | |
// author: Oleksandr Khotemskyi <xotabu4@github.io> | |
// version: 1.0 | |
// includes: ^runs/view | |
// excludes: | |
// js: | |
$(document).ready( function () { | |
// TestRail project id -> gitlab pipeline |
// Somewhere in protractor onPrepare: | |
onPrepare: function () { | |
patchProtractorWait() | |
afterEach(async function () { | |
// Wait fix needs to be re-applied after browser restart, checking if function was patched already: | |
const waitFunctionSymbols = Object.getOwnPropertySymbols(browser.wait); | |
if (!waitFunctionSymbols.includes(WAIT_FIX)) { | |
patchProtractorWait(); |
import { browser } from 'protractor'; | |
/** | |
* @experimental | |
*/ | |
export function registerCloseBrowserOnProcessEndListener() { | |
async function exitHandler(options, exitCode) { | |
console.log('[registerCloseBrowserOnProcessEndListener] called!'); | |
try { | |
await browser.close(); |
/** | |
* @experimental | |
* This function tries to highligh exact point at webpage where click was failed, | |
* by placing special red square into failed coordinate. | |
* So allure screenshots will show exact failing location | |
* @param error exception object | |
*/ | |
async function drawClickPointAttempt(error: Error) { | |
try { | |
const text = error.message; |
const sendCommand = (target, method, params) => { | |
return new Promise((resolve, reject) => { | |
chrome.debugger.sendCommand(target, method, params, result => { | |
if (chrome.runtime.lastError) { | |
reject(chrome.runtime.lastError); | |
} else { | |
resolve(result); | |
console.log(method, result); | |
} | |
}); |
import * as path from 'path' | |
import * as fs from 'fs' | |
const resFolderImages = './resources/images/' | |
const resFolderAudio = './resources/audio/' | |
const resFolderOffice = './resources/office/' | |
const resFolderVideos = './resources/videos/' | |
const resFolderOther = './resources/other/' | |
export interface FileStats { |
import { browser, By, element, ElementFinder, ExpectedConditions as EC } from 'protractor'; | |
class LoginModal { | |
private get shadowDOM() { | |
return element(By.js(function () { | |
// returned value must be array | |
return [document.querySelector('CSSselectorForShadowDomContainingElement').shadowRoot]; | |
})); | |
} |