This repository has been archived by the owner on Mar 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ let package = Package( | |
"Config", | ||
"Public", | ||
"JS", | ||
"Tests", | ||
"Resources", | ||
"node_modules", | ||
] | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
env: | ||
mocha: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const webdriverio = require('webdriverio'); | ||
import { expect } from 'chai'; | ||
|
||
const options = { | ||
desiredCapabilities: { | ||
browserName: 'phantomjs' | ||
}, | ||
// logLevel: 'verbose', | ||
baseUrl: 'http://localhost:8080', | ||
port: 4444 | ||
}; | ||
|
||
describe("Integration", () => { | ||
let client; | ||
|
||
beforeEach(() => { | ||
client = webdriverio | ||
.remote(options) | ||
.init(); | ||
}); | ||
|
||
it("should work with bare server", () => { | ||
return client | ||
.url('http://localhost:8080/') | ||
.getTitle().then(title => { | ||
expect(title).to.equal("React+Swift Test App"); | ||
}) | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 42"); | ||
}) | ||
.click("button") | ||
.click("button") | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 44"); | ||
}) | ||
.click("button + button") | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 43"); | ||
}); | ||
}); | ||
|
||
it("should work with dev server", () => { | ||
return client | ||
.url('http://localhost:8081/') | ||
.getTitle().then(title => { | ||
expect(title).to.equal("React+Swift Test App"); | ||
}) | ||
.waitForExist("#root p:first-of-type", 5000) | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 42"); | ||
}) | ||
.click("button") | ||
.click("button") | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 44"); | ||
}) | ||
.click("button + button") | ||
.getText("#root p:first-of-type").then(text => { | ||
expect(text).to.equal("Value: 43"); | ||
}); | ||
}); | ||
}); |
This file contains 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