Created
May 1, 2013 22:06
-
-
Save dmose/5498758 to your computer and use it in GitHub Desktop.
Here's a simple diff that gets two people logged in at the same time. CC @Standard8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/test/functional/app_test.js b/test/functional/app_test.js | |
index 1e40641..57e4360 100644 | |
--- a/test/functional/app_test.js | |
+++ b/test/functional/app_test.js | |
@@ -12,6 +12,7 @@ var webdriver = require('selenium-webdriver'), | |
By = webdriver.By; | |
var driver; | |
+var driver2; | |
describe("browser tests", function() { | |
this.timeout(60000); | |
@@ -22,12 +23,19 @@ describe("browser tests", function() { | |
usingServer('http://localhost:4444/wd/hub'). | |
withCapabilities({'browserName': 'firefox'}). | |
build(); | |
+ | |
+ driver2 = new webdriver.Builder(). | |
+ usingServer('http://localhost:4444/wd/hub'). | |
+ withCapabilities({'browserName': 'firefox'}). | |
+ build(); | |
done(); | |
}); | |
}); | |
after(function(done) { | |
+ driver2.quit() | |
driver.quit(); | |
+; | |
app.shutdown(done); | |
}); | |
@@ -49,7 +57,15 @@ describe("browser tests", function() { | |
driver.findElement(By.css("div.alert-info")).getText() | |
.then(function(alert) { | |
expect(alert).to.contain('only person'); | |
- done(); | |
+ | |
+ driver2.get(serverHttpBase); | |
+ driver2.findElement(By.name("nick")).sendKeys("larry"); | |
+ driver2.findElement(By.id("submit")).click(); | |
+ driver2.findElement(By.css("strong.nick")).getText().then(function(nick) { | |
+ expect(nick).to.equal('larry'); | |
+ | |
+ done(); | |
+ }); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment