Guest User

Untitled

a guest
Nov 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  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. })
Add Comment
Please, Sign In to add comment