Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion conf/base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ exports.config = {
global.expect = chai.expect;
chai.Should();
},
afterTest: async (test, context, { error, result, duration, passed, retries }) => {
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~ AFTER TEST HOOK TIMESTAMP :: ${Date.now()} ~~~~~~~~~~~~~~~~~~~~~~~~`)
},
after: function (result, capabilities, specs) {
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~ AFTER HOOK TIMESTAMP :: ${Date.now()} ~~~~~~~~~~~~~~~~~~~~~~~~`)
},

framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 60000,
timeout: 5000,
},
};
31 changes: 0 additions & 31 deletions conf/local-test.conf.js

This file was deleted.

21 changes: 5 additions & 16 deletions conf/test.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const parallelConfig = {
services: [
[
'browserstack',
{ buildIdentifier: '#${BUILD_NUMBER}' },
{
testObservability: false,
buildIdentifier: '#${BUILD_NUMBER}'
},
],
],
capabilities: [
Expand All @@ -22,21 +25,7 @@ const parallelConfig = {
os: 'Windows',
osVersion: '10',
},
},
{
browserName: 'safari',
browserVersion: 'latest',
'bstack:options': {
os: 'OS X',
osVersion: 'Big Sur',
},
},
{
browserName: 'chrome',
'bstack:options': {
deviceName: 'Samsung Galaxy S20',
},
},
}
],
};

Expand Down
10 changes: 0 additions & 10 deletions tests/specs/local_test.js

This file was deleted.

21 changes: 2 additions & 19 deletions tests/specs/test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
describe("Testing with BStackDemo", () => {
it("add product to cart", async () => {
await browser.url("https://bstackdemo.com/");
await browser.waitUntil(
async () => (await browser.getTitle()).match(/StackDemo/i),
5000,
"Title didn't match with BrowserStack"
);

const productOnScreen = await $('//*[@id="1"]/p');
const productOnScreenText = await productOnScreen.getText();

const addToCart = await $('//*[@id="1"]/div[4]');
await addToCart.click();

const productInCart = await $('//*[@id="__next"]/div/div/div[2]/div[2]/div[2]/div/div[3]/p[1]');

await browser.waitUntil(async () => (
await productInCart.getText()).match(productOnScreenText),
{ timeout: 5000 }
);
console.log("FROM TEST")
await new Promise(r => setTimeout(r, 5000));
});
});