basic_test.js 595 B

12345678910111213141516171819202122232425262728
  1. /// <reference path="./steps.d.ts" />
  2. const express = require("express");
  3. BeforeSuite((I) => {
  4. const app = express()
  5. app.use(express.static('public'))
  6. app.listen(3456)
  7. });
  8. Feature('Connection');
  9. Scenario('Data Channel ping pong', async (I) => {
  10. I.amOnPage("http://localhost:3456")
  11. I.wait(2)
  12. I.openNewTab();
  13. I.amOnPage("http://localhost:3456")
  14. I.wait(2)
  15. const id2 = await I.grabTextFrom("#id")
  16. I.switchToPreviousTab(1)
  17. I.wait(1)
  18. I.executeScript(`connect("${id2}")`)
  19. I.wait(2)
  20. I.see("pong")
  21. });
  22. AfterSuite((I) => {
  23. process.exit(0)
  24. })