Skip to content

Instantly share code, notes, and snippets.

@marlun
Created December 11, 2016 21:10
Show Gist options
  • Save marlun/d1fdf4a51412cff43b2d85e89a2bfff2 to your computer and use it in GitHub Desktop.
Save marlun/d1fdf4a51412cff43b2d85e89a2bfff2 to your computer and use it in GitHub Desktop.
Testing with tape and selenium-webdriver (probably wrong)
test.only('Give error when username and password is missing', function (t) {
t.plan(1);
browser.get('http://localhost:3000/');
browser.findElement({ className: 'login__submit' })
.click();
browser.wait(Until.elementIsVisible(By.className('login__error')));
t.ok(true);
browser.quit();
});
/*
TypeError: element.isDisplayed is not a function
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/until.js:303:20
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/webdriver.js:947:14
at TaskQueue.execute_ (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2860:25)
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: <anonymous>
at pollCondition (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2101:19)
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2097:7
at new ManagedPromise (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:1067:7)
at ControlFlow.promise (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2396:12)
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2096:22
at TaskQueue.execute_ (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: Waiting until element is visible
at scheduleWait (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2094:20)
at ControlFlow.wait (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/promise.js:2408:12)
at thenableWebDriverProxy.wait (/Users/martinlu/Projects/test/node_modules/selenium-webdriver/lib/webdriver.js:943:29)
at Test.<anonymous> (/Users/martinlu/Projects/test/index2.js:24:11)
at Test.bound [as _cb] (/Users/martinlu/Projects/test/node_modules/tape/lib/test.js:66:32)
at Test.run (/Users/martinlu/Projects/test/node_modules/tape/lib/test.js:85:10)
at Test.bound [as run] (/Users/martinlu/Projects/test/node_modules/tape/lib/test.js:66:32)
at Immediate.next (/Users/martinlu/Projects/test/node_modules/tape/lib/results.js:71:15)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment