-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bstack demo example (#3405)
- Loading branch information
1 parent
3901dca
commit 2bb54d3
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe('Authentication Tests', function () { | ||
beforeEach((browser) => browser.navigateTo('https://www.bstackdemo.com')); | ||
|
||
it('Login test', function () { | ||
browser | ||
.click('#signin') | ||
.setValue('#username input', ['demouser', browser.Keys.ENTER]) | ||
.setValue('#password input', ['testingisfun99', browser.Keys.ENTER]) | ||
.click('#login-btn') | ||
.assert.textEquals('.username', 'demouser', 'demouser had logged in successfuly.'); | ||
}); | ||
|
||
it('Locked account test', function () { | ||
browser | ||
.click('#signin') | ||
.setValue('#username input', ['locked_user', browser.Keys.ENTER]) | ||
.setValue('#password input', ['testingisfun99', browser.Keys.ENTER]) | ||
.click('#login-btn') | ||
.assert.textContains('.api-error', 'Your account has been locked.'); | ||
}); | ||
|
||
afterEach((browser) => browser.end()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
describe('Checkout Test', function () { | ||
before((browser) => browser.navigateTo('https://www.bstackdemo.com/')); | ||
|
||
it('checkout products on bstackdemo.com', function (browser) { | ||
browser | ||
.waitForElementVisible('body') | ||
.assert.titleContains('StackDemo') | ||
// Filter Google from the avaialble filters | ||
.click('input[value=\'Google\'] + span') | ||
.assert.selected('input[value=\'Google\']') | ||
// Add different phones to cart | ||
.click('[id="17"] .shelf-item__buy-btn') | ||
.click('[id="18"] .shelf-item__buy-btn') | ||
.assert.elementsCount('.float-cart__shelf-container .shelf-item', 2) | ||
// Click checkout | ||
.click('.buy-btn') | ||
// Loging with given credentials | ||
.setValue('#username input', ['demouser', browser.Keys.ENTER]) | ||
.setValue('#password input', ['testingisfun99', browser.Keys.ENTER]) | ||
.click('#login-btn') | ||
// Fill shipping details | ||
.setValue('#firstNameInput', 'John') | ||
.setValue('#lastNameInput', 'Doe') | ||
.setValue('#addressLine1Input', 'localhost') | ||
.setValue('#provinceInput', 'local') | ||
.setValue('#postCodeInput', '127001') | ||
.click('#checkout-shipping-continue') | ||
// Check order successfully placed | ||
.assert.textEquals('#confirmation-message', 'Your Order has been successfully placed.'); | ||
}); | ||
|
||
after((browser) => browser.end()); | ||
}); |