daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Nov 19th, 2018 67 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. let specPage = require('../pages/spec.po.js');
  2.  
  3. let chai = require('chai');
  4. let chaiAsPromised = require('chai-as-promised');
  5. chai.use(chaiAsPromised);
  6. let expect = chai.expect;
  7. var { setDefaultTimeout } = require('cucumber');
  8. setDefaultTimeout(60 * 1050);
  9.  
  10. Before(async function () {
  11.     await specPage.init();
  12. })
  13.  
  14. Given('The user go to {string}', async function (string) {
  15.     await specPage.get(string);
  16. });
  17.  
  18. When('The user adds {string} in the name field', async function (string) {
  19.     await specPage.setName(string);
  20. });
  21.  
  22. Then('The user should see Hello with the username', async function () {
  23.     await expect(specPage.getGreetingText())
  24.         .to.eventually.equal('Hello Tulio!!')
  25. });
  26.  
  27. Then('The user should see Hello with the username success', async function () {
  28.     await expect(specPage.getGreetingText())
  29.         .to.eventually.equal('Hello Tulio!')
  30. });
  31.  
  32. Then('The user should see Hello with the username success 2', async function () {
  33.     await expect(specPage.getGreetingText())
  34.         .to.eventually.equal('Hello Tulio!')
  35. });
  36.  
  37. After(function (test) {
  38.     browser.manage().addCookie({ name: 'zaleniumTestPassed', value: test.result.status == 'failed' ? 'false' : 'true' });
  39. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top