Skip to content

Commit

Permalink
test: add wait for ci (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored May 10, 2024
1 parent f09ce65 commit e8f8884
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"@types/chai-as-promised": "7.1.8",
"@types/mocha": "10.0.6",
"@types/node": "20.12.2",
"asyncbox": "^3.0.0",
"chai": "4.4.1",
"chai-as-promised": "7.1.1",
"conventional-changelog-conventionalcommits": "7.0.2",
Expand Down
19 changes: 18 additions & 1 deletion test/e2e/driver.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {main as startAppium} from 'appium';
import { waitForCondition } from 'asyncbox';
import path from 'path';
import {remote} from 'webdriverio';

Expand Down Expand Up @@ -118,7 +119,23 @@ describe('ChromeDriver', function() {
await d.sessionSubscribe({events: ['network.responseCompleted'], contexts: [contexts[0].context]});
networkResponses.should.be.empty;
await d.navigateTo(`${SERVER_URL}/test/guinea-pig`);
networkResponses.should.not.be.empty;
try {
await waitForCondition(() => {
try {
networkResponses.should.not.be.empty;
return true;
} catch (ign) {
return false;
}
},
{
waitMs: 5000,
intervalMs: 100,
},
);
} catch (err) {
networkResponses.should.not.be.empty;
}
});

});
Expand Down

0 comments on commit e8f8884

Please sign in to comment.