Passed
Pull Request — master (#2)
by
unknown
03:24
created

test/test.js   A

Complexity

Total Complexity 10
Complexity/F 1

Size

Lines of Code 48
Function Count 10

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 10
eloc 24
mnd 0
bc 0
fnc 10
dl 0
loc 48
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
/**
2
 * Test for getting started with Selenium.
3
 */
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