Skip to content

Commit 6ce9f13

Browse files
test
1 parent d0b8fc8 commit 6ce9f13

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ steps:
2424
npm i
2525
npm i "$(downloadSecureFileStep.secureFilePath)"
2626
npx browserstack-node-sdk --version
27+
echo "RUNNING TEST"
28+
npm run sample-test
2729
env:
2830
BROWSERSTACK_USERNAME: $(BROWSERSTACK_USERNAME)
2931
BROWSERSTACK_ACCESS_KEY: ${BROWSERSTACK_ACCESS_KEY}

browserstack.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ platforms:
3131
osVersion: 11
3232
browserName: chrome
3333
browserVersion: latest
34-
- os: OS X
35-
osVersion: Ventura
36-
browserName: playwright-webkit
37-
browserVersion: latest
38-
- os: Windows
39-
osVersion: 11
40-
browserName: playwright-firefox
41-
browserVersion: latest
34+
# - os: OS X
35+
# osVersion: Ventura
36+
# browserName: playwright-webkit
37+
# browserVersion: latest
38+
# - os: Windows
39+
# osVersion: 11
40+
# browserName: playwright-firefox
41+
# browserVersion: latest
4242

4343
# =======================
4444
# Parallels per Platform
@@ -57,7 +57,7 @@ parallelsPerPlatform: 1
5757
# ==========================================
5858
# Set browserStackLocal to true if your website under test is not accessible publicly over the internet
5959
# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
60-
browserstackLocal: true # <boolean> (Default false)
60+
browserstackLocal: false # <boolean> (Default false)
6161
# browserStackLocalOptions:
6262
# Options to be passed to BrowserStack local in-case of advanced configurations
6363
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This is a sample config for what users might be running locally
22
const config = {
33
testDir: './tests',
4-
testMatch: '**/bstack_test*.js',
4+
testMatch: '**/bstack_test_add*.js',
55

66
/* Maximum time one test can run for. */
77
timeout: 90 * 1000,

tests/bstack_test_add_to_cart.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,20 @@ test('BStackDemo test add to cart', async ({ page }) => {
1616
// check if product in cart is same as one added
1717
expect(productInCart).toEqual(productToAdd);
1818
});
19+
20+
test('BStackDemo test add to cart failed', async ({ page }) => {
21+
// visit the site
22+
await page.goto('https://bstackdemo.com/');
23+
24+
// get name of product we want to add to cart\
25+
const productToAdd = await page.locator('#\\33 > p').textContent();
26+
27+
// click on add to cart
28+
await page.click('#\\33 > .shelf-item__buy-btn');
29+
30+
// get name of item in cart
31+
const productInCart = await page.textContent('#__next > div > div > div.float-cart.float-cart--open > div.float-cart__content > div.float-cart__shelf-container > div > div.shelf-item__details > p.title');
32+
33+
// check if product in cart is same as one added
34+
expect(productInCart).toEqual("failed test");
35+
});

0 commit comments

Comments
 (0)