Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
add test for quering an open zipkin instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Schmidt committed Oct 25, 2017
1 parent 012db88 commit 938846d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ matrix:
- 'cat coverage/lcov.info | ./node_modules/.bin/coveralls'

# E2E Web
- install:
- services:
- docker
install:
- cd example/react-example
- yarn install
before_script:
- yarn run build
- docker run -d -p 9411:9411 openzipkin/zipkin
script:
- yarn test
27 changes: 19 additions & 8 deletions example/react-example/cypress/integration/basic_spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import fetch from "node-fetch";

describe("Basic", () => {
it("should be able interact with the basic example", () => {
cy.visit("/");
cy.get("#Basic").click();
cy.get("#buttonLabel").should($p => {
expect($p.first()).to.contain("Not-Pressed");
describe("Setup", () => {
it("should be able interact with the basic example", () => {
cy.visit("/");
cy.get("#Basic").click();
cy.get("#buttonLabel").should($p => {
expect($p.first()).to.contain("Not-Pressed");
});
cy.get("#basicButton").click();
cy.get("#buttonLabel").should($p => {
expect($p.first()).to.contain("Is-Pressed");
});
});
cy.get("#basicButton").click();
cy.get("#buttonLabel").should($p => {
expect($p.first()).to.contain("Is-Pressed");

it("should be able to access zipkin", async () => {
const result = await fetch(
"http://localhost:9411/api/v1/spans?serviceName=frontend"
).then(res => res.json());
expect(result).toEqual([]);
});
});
});
1 change: 1 addition & 0 deletions example/react-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"devDependencies": {
"cypress": "^1.0.2",
"node-fetch": "^1.7.3",
"serve": "^6.3.1"
}
}
2 changes: 1 addition & 1 deletion example/react-example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4565,7 +4565,7 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"

node-fetch@^1.0.1:
node-fetch@^1.0.1, node-fetch@^1.7.3:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
dependencies:
Expand Down

0 comments on commit 938846d

Please sign in to comment.