Skip to content

Commit

Permalink
ci: use fdp-play for tests (#139)
Browse files Browse the repository at this point in the history
* ci: use fdp-play for tests

* test: log errors

* test: add latency
  • Loading branch information
tomicvladan authored Sep 6, 2022
1 parent cfe59c5 commit 871f09c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ jobs:
- name: Compile
run: npm run compile

# Start Bee Factory environment
- name: Start Bee Factory environment
run: npm run bee -- --detach
- name: Install fdp-play
run: npm install -g @fairdatasociety/fdp-play

- name: Run fdp-play
run: fdp-play start -d

- name: Run tests
uses: vojtechsimetka/puppeteer-headful@master
Expand Down
1 change: 1 addition & 0 deletions test/bzz-protocol.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ describe('BZZ protocol', () => {
test('Fetch Real Bee API URL', async done => {
await page.click('#button-fetch-real-bee-api-url')
const placeHolderSelector = '#bee-api-url-placeholder'
await new Promise(resolve => setTimeout(resolve, 500))
await page.waitForSelector(placeHolderSelector)
const value = await page.$eval(placeHolderSelector, e => e.innerHTML)
expect(value).toBe(BEE_API_URL) //default value of Bee API URL in the extension
Expand Down
5 changes: 4 additions & 1 deletion test/bzz-test-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ const web2Helper = window.swarm.web2Helper
const postageBatch = window.swarm.postageBatch

function fetchBeeApiUrl() {
web2Helper.beeApiUrl().then(url => (document.getElementById('bee-api-url-placeholder').innerHTML = url))
web2Helper
.beeApiUrl()
.then(url => (document.getElementById('bee-api-url-placeholder').innerHTML = url))
.catch(error => (document.getElementById('bee-api-url-placeholder').innerHTML = JSON.stringify(error)))
}

function fetchGlobalPostageBatch() {
Expand Down

0 comments on commit 871f09c

Please sign in to comment.