Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {assert} = require('chai');
  2. const {jsdom} = require('jsdom');
  3.  
  4. const parseTextFromHTML = (htmlAsString, selector) => {
  5.   const selectedElement = jsdom(htmlAsString).querySelector(selector);
  6.   if (selectedElement !== null) {
  7.     return selectedElement.textContent;
  8.   } else {
  9.     throw new Error(`No element with selector ${selector} found in HTML string`);
  10.   }
  11. };
  12.  
  13. describe('User visits Quick Add Task', () => {
  14.     it('starts with a blank task', () => {
  15.         browser.url('http://localhost:8080/');
  16.  
  17.         const elem = $('#inbox-clickable');
  18.         console.log(elem.getText());
  19.  
  20.         assert.equal(elem.getText(), 'Inbox');
  21.        
  22.     })
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement