SHARE
TWEET

Untitled

a guest Jul 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Перейдем в Отправленные и проврим наличие письма
  2.     let sendTab = await page.$(settings.outBoxButton);
  3.     await sendTab.click();
  4.     let sentMessageTitle = await page.waitForXPath(`//*[contains(text(),'${settings.letterTitle}')]`);
  5.     await sentMessageTitle.click()
  6.     // Проверим, что адресат, название, содержание совпадают
  7.     let messageTitleElem = await page.waitForSelector(settings.outboxResultSelector);
  8.     let messageTitleText = await page.evaluate(element => element.textContent, messageTitleElem);
  9.     let messageText = await page.$eval(settings.sendMessageContentSelector, elem => elem.textContent);
  10.     let messageAddressElem = await page.waitForXPath(`//*[contains(text(),'${settings.sendingAddressShortend}')]`);
  11.     let messageAddress = await page.evaluate(element => element.textContent, messageAddressElem);
  12.  
  13.     expect(messageTitleText).to.equal(settings.letterTitle);
  14.     expect(messageText).to.equal(settings.letterContent);
  15.     expect(messageAddress).to.equal(settings.sendingAddressShortend);
  16.   });
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top