Skip to content

Instantly share code, notes, and snippets.

View klamping's full-sized avatar

Kevin Lamping klamping

View GitHub Profile
@klamping
klamping / wdio-best-practices.md
Last active February 27, 2024 08:25 — forked from jrobinson01/wdio-best-practices.md
WDIO testing best practices

WDIO Testing Best Practices

  • Use page objects
  • avoid protocol methods and prefer commands
  • don't use timeouts unless you have a good reason
  • use waitFor, waitForVisible etc
  • avoid caching elements
  • avoid arbitrary pause() calls
  • use mocks

Protocol commands

(function() {
var codeBlocks = document.getElementsByTagName('pre'),
codeLines = 0,
body = document.getElementsByTagName('body')[0],
text = function(el) {
if (el.innerText) return el.innerText;
return el.textContent;
};
var trimEmptyLines = function (lines) {