| Total Complexity | 10 |
| Complexity/F | 1 |
| Lines of Code | 48 |
| Function Count | 10 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 4 | "use strict"; |
||
| 5 | |||
| 6 | const assert = require("assert"); |
||
| 7 | const test = require("selenium-webdriver/testing"); |
||
| 8 | const webdriver = require("selenium-webdriver"); |
||
| 9 | const By = require("selenium-webdriver").By; |
||
| 10 | |||
| 11 | var browser = new webdriver.Builder(). |
||
| 12 | withCapabilities(webdriver.Capabilities.firefox()) |
||
| 13 | .build(); |
||
| 14 | |||
| 15 | browser.get("http://localhost:3001"); |
||
| 16 | |||
| 17 | |||
| 18 | browser.getTitle().then(function(title) { |
||
| 19 | assert.equal(title, "React App"); |
||
| 20 | }); |
||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | browser.navigate().to("http://localhost:3001/reports/week/1").then(function( title ) { |
||
| 25 | browser.findElement(By.linkText("Week2")).then(function(element){ |
||
| 26 | element.getText().then(function(text){ |
||
| 27 | assert.equal(text, "Week2"); |
||
| 28 | }); |
||
| 29 | }) |
||
| 30 | }); |
||
| 31 | |||
| 32 | browser.navigate().to("http://localhost:3001/chat").then(function() { |
||
| 33 | browser.findElement(By.tagName("h4")).then(function(element){ |
||
| 34 | element.getText().then(function(text){ |
||
| 35 | assert.equal(text, "Chat"); |
||
| 36 | }); |
||
| 37 | }) |
||
| 38 | }); |
||
| 39 | |||
| 40 | |||
| 41 | browser.navigate().to("http://localhost:3001/chat").then(function() { |
||
| 42 | browser.findElement(By.className("join-chat-btn")).then(function(element){ |
||
| 43 | element.getTagName().then(function(tag){ |
||
| 44 | assert.equal(tag, "input"); |
||
| 45 | }); |
||
| 46 | }) |
||
| 47 | }); |
||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | browser.quit(); |
||
| 52 | |||
| 53 |