-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
13,270 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,13 @@ | ||
FROM node:18 AS runner | ||
|
||
COPY ./integration-tests/configs ./configs | ||
COPY ./integration-tests/helpers ./helpers | ||
COPY ./integration-tests/pages ./pages | ||
COPY ./integration-tests/specs ./specs | ||
|
||
COPY ./integration-tests/package.json ./ | ||
COPY ./integration-tests/tsconfig.json ./ | ||
|
||
RUN npm install | ||
|
||
ENTRYPOINT ["npm", "run", "login-test"] |
74 changes: 74 additions & 0 deletions
74
visual-js/visual-wdio/integration-tests/configs/e2e.constants.ts
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,74 @@ | ||
const USERNAME = | ||
process.env.VISUAL_CHECK === 'true' ? 'visual_user' : 'standard_user'; | ||
const PASSWORD = 'secret_sauce'; | ||
export const DEFAULT_TIMEOUT = 30 * 1000; | ||
export const PAGES = { | ||
CART: '/cart.html', | ||
CHECKOUT_COMPLETE: '/checkout-complete.html', | ||
CHECKOUT_PERSONAL_INFO: '/checkout-step-one.html', | ||
CHECKOUT_SUMMARY: '/checkout-step-two.html', | ||
LOGIN: '/', | ||
SWAG_DETAILS: '/inventory-item.html', | ||
SWAG_ITEMS: '/inventory.html', | ||
SWAG_ITEMS_LONG: '/inventory-long.html', | ||
}; | ||
export const PRODUCTS = { | ||
BIKE_LIGHT: 0, | ||
BOLT_SHIRT: 1, | ||
ONE_SIE: 2, | ||
TATT_SHIRT: 3, | ||
BACKPACK: 4, | ||
FLEECE_JACKET: 5, | ||
}; | ||
export const LOGIN_USERS = { | ||
LOCKED: { | ||
username: 'locked_out_user', | ||
password: PASSWORD, | ||
}, | ||
NO_MATCH: { | ||
username: 'd', | ||
password: 'd', | ||
}, | ||
NO_USER_DETAILS: { | ||
username: '', | ||
password: '', | ||
}, | ||
NO_PASSWORD: { | ||
username: USERNAME, | ||
password: '', | ||
}, | ||
PERFORMANCE: { | ||
username: 'performance_glitch_user', | ||
password: PASSWORD, | ||
}, | ||
STANDARD: { | ||
username: USERNAME, | ||
password: PASSWORD, | ||
}, | ||
VISUAL: { | ||
username: 'visual_user', | ||
password: PASSWORD, | ||
}, | ||
}; | ||
export const PERSONAL_INFO = { | ||
STANDARD: { | ||
firstName: 'Sauce', | ||
lastName: 'Bot', | ||
zip: '94105', | ||
}, | ||
NO_FIRSTNAME: { | ||
firstName: '', | ||
lastName: 'Bot', | ||
zip: '94105', | ||
}, | ||
NO_LAST_NAME: { | ||
firstName: 'Sauce', | ||
lastName: '', | ||
zip: '94105', | ||
}, | ||
NO_POSTAL_CODE: { | ||
firstName: 'Sauce', | ||
lastName: 'Bot', | ||
zip: '', | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
visual-js/visual-wdio/integration-tests/configs/wdio.saucelabs.desktop.conf.ts
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,30 @@ | ||
import type { Options } from '@wdio/types'; | ||
import { config as sauceSharedConfig } from './wdio.saucelabs.shared.conf.ts'; | ||
|
||
const buildName = `Sauce Demo Test - ${new Date().getTime()}`; | ||
|
||
export const config: Options.Testrunner = { | ||
...sauceSharedConfig, | ||
// | ||
// ============ | ||
// Capabilities | ||
// ============ | ||
capabilities: [ | ||
{ | ||
browserName: 'chrome', | ||
browserVersion: 'latest', | ||
platformName: 'Windows 11', | ||
'sauce:options': { | ||
screenResolution: '2560x1600', | ||
build: buildName, | ||
}, | ||
}, | ||
], | ||
// ===== | ||
// Hooks | ||
// ===== | ||
before: async (_capabilities, _specs) => { | ||
// Set all browsers to the "same" viewport | ||
await browser.setWindowRect(null, null, 1920, 1080); | ||
}, | ||
}; |
46 changes: 46 additions & 0 deletions
46
visual-js/visual-wdio/integration-tests/configs/wdio.saucelabs.shared.conf.ts
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,46 @@ | ||
import type { Options } from '@wdio/types'; | ||
import { config as sharedConfig } from './wdio.shared.conf.ts'; | ||
import { getSauceCredentials } from '../helpers/index.ts'; | ||
|
||
// | ||
// Get the Sauce Labs credentials | ||
const { sauceUsername, sauceAccessKey } = await getSauceCredentials(); | ||
|
||
export const config: Options.Testrunner = { | ||
...sharedConfig, | ||
// | ||
// ================= | ||
// Service Providers | ||
// ================= | ||
user: sauceUsername, | ||
key: sauceAccessKey, | ||
region: (process.env.REGION || 'us') as Options.SauceRegions, | ||
// | ||
// ============ | ||
// Capabilities | ||
// ============ | ||
// Are not configured here, they can be found in: | ||
// - wdio.saucelabs.desktop.conf.ts | ||
// - wdio.saucelabs.mobile.conf.ts | ||
// | ||
// ======== | ||
// Services | ||
// ======== | ||
services: (sharedConfig.services || []).concat([ | ||
// | ||
// This service is needed for WDIO to make sure it can connect to Sauce Labs to: | ||
// - automatically update the names | ||
// - automatically update the status (passed/failed) | ||
// - automatically send the stacktrace in case of a failure | ||
// | ||
'sauce', | ||
// | ||
// This service is needed for the Sauce Visual service to work | ||
// | ||
[ | ||
'@saucelabs/wdio-sauce-visual-service', | ||
// The options for the Sauce Visual service | ||
{}, | ||
], | ||
]), | ||
}; |
Oops, something went wrong.