Skip to content
This repository was archived by the owner on Oct 27, 2021. It is now read-only.

Commit 023d116

Browse files
author
Ian Walter
committed
Adding test and dotenv
1 parent 90abc89 commit 023d116

File tree

7 files changed

+64
-16
lines changed

7 files changed

+64
-16
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
.env

example.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SELENIUM_STANDALONE=true
2+
#BROWSERSTACK_ACCESS_KEY=

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
require('dotenv').config()
12
const { Print } = require('@ianwalter/print')
23

3-
const hasBsl = cap => cap['bstack:options'] && cap['bstack:options'].local
4+
const hasBsl = cap => cap && cap['bstack:options'] && cap['bstack:options'].local
45

56
function shouldStartBsl (capabilities) {
67
if (Array.isArray(capabilities)) {

package.json

+31-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"main": "index.js",
99
"scripts": {
1010
"lint": "eslint index.js",
11+
"test": "bff",
1112
"postinstall": "node postinstall.js"
1213
},
1314
"repository": {
@@ -28,16 +29,44 @@
2829
"browserstack"
2930
],
3031
"dependencies": {
31-
"@ianwalter/bsl": "^1.0.1",
32+
"@ianwalter/bsl": "^1.1.1",
3233
"@ianwalter/print": "^2.3.0",
34+
"dotenv": "^7.0.0",
3335
"selenium-standalone": "^6.16.0",
3436
"webdriverio": "^5.7.14"
3537
},
3638
"devDependencies": {
37-
"@ianwalter/bff": "^2.10.0",
39+
"@ianwalter/bff": "^3.1.0",
3840
"@ianwalter/eslint-config": "^1.1.2",
3941
"np": "^5.0.0"
4042
},
43+
"bff": {
44+
"before": [
45+
"../../../"
46+
],
47+
"registration": [
48+
"../../../"
49+
],
50+
"beforeEach": [
51+
"../../../"
52+
],
53+
"afterEach": [
54+
"../../../"
55+
],
56+
"after": [
57+
"../../../"
58+
],
59+
"webdriver": {
60+
"capabilities": {
61+
"browserName": "firefox",
62+
"bstack:options": {
63+
"local": true,
64+
"projectName": "bff-webdriver",
65+
"timezone": "EST"
66+
}
67+
}
68+
}
69+
},
4170
"eslintConfig": {
4271
"root": true,
4372
"extends": [

postinstall.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require('dotenv').config()
2+
13
async function install () {
24
const selenium = require('selenium-standalone')
35
try {

tests.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const { test } = require('@ianwalter/bff')
2+
3+
test('mybinxhealth.com', async ({ browser, expect }) => {
4+
await browser.url('https://mybinxhealth.com/')
5+
expect(await browser.getTitle()).toContain('binx health')
6+
})

yarn.lock

+20-13
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@
119119
lodash "^4.17.11"
120120
to-fast-properties "^2.0.0"
121121

122-
"@ianwalter/bff@^2.10.0":
123-
version "2.10.0"
124-
resolved "https://registry.yarnpkg.com/@ianwalter/bff/-/bff-2.10.0.tgz#ac57ff0dbef86a5ff8b61a6feb82f7f4bd8808b3"
125-
integrity sha512-nPMbXthsDMBUwOzIxbsUmP8GC8vr3Ech3Bx9OeVGYkvBRUay7MiNZAIgbMOPjXYFkq/RVFmhE9lx9f0rVOCsVw==
122+
"@ianwalter/bff@^3.1.0":
123+
version "3.1.0"
124+
resolved "https://registry.yarnpkg.com/@ianwalter/bff/-/bff-3.1.0.tgz#71e7983d8aa4a9489ccaee12886375284c804a83"
125+
integrity sha512-HoRD06Z4UTYJ6H62SwjA4OwrxFckpkzRzzFCtXM7ZnnqdQBfpchwL1c+JICE7m3E9hgipDKf2j9cik9JmCBa3w==
126126
dependencies:
127-
"@ianwalter/cli" "^1.0.0"
127+
"@ianwalter/cli" "^1.1.0"
128128
"@ianwalter/print" "^2.3.0"
129129
common-tags "^1.8.0"
130130
expect "^24.7.1"
@@ -134,22 +134,24 @@
134134
p-timeout "^3.1.0"
135135
workerpool "^3.1.2"
136136

137-
"@ianwalter/bsl@^1.0.1":
138-
version "1.0.1"
139-
resolved "https://registry.yarnpkg.com/@ianwalter/bsl/-/bsl-1.0.1.tgz#aa31783b5d0effbeb235cf9f8b0e47b1c94001a5"
140-
integrity sha512-Hv8jYWb0U/6U2YfalpZulq4l4T68URrOBdlEctMyX/7HDzw/oZFO8U7aVDtrmbbiLTPI6U9FtZ97rHkf5MfYJw==
137+
"@ianwalter/bsl@^1.1.1":
138+
version "1.1.1"
139+
resolved "https://registry.yarnpkg.com/@ianwalter/bsl/-/bsl-1.1.1.tgz#ce2fb52b5a672712a80a3b39ef2316a3f87b5d31"
140+
integrity sha512-d+qW7l/SFsQEr+M1B21VIvUg3w8tTYVLDI768i4XyB2Xse14zpY7/wqcGQSalPgCbj8TKWY/c5Ayqm1A24AOTg==
141141
dependencies:
142142
browserstack-local "^1.3.7"
143143
conf "^4.0.0"
144+
dotenv "^7.0.0"
144145
fkill "^6.1.0"
145146
meow "^5.0.0"
146147
signale "^1.4.0"
147148

148-
"@ianwalter/cli@^1.0.0":
149-
version "1.0.0"
150-
resolved "https://registry.yarnpkg.com/@ianwalter/cli/-/cli-1.0.0.tgz#73d803468c11bde5afac4b5eedfc4ac33ae36f12"
151-
integrity sha512-MDcYFW9Ksb2jHfQ/v2QJRsEp/5Raz9FxUx2GLGjLWuqfk1GwWOGxJ9As7tJAuE9stVbZa1o/Gi753QWb8PZzQw==
149+
"@ianwalter/cli@^1.1.0":
150+
version "1.1.0"
151+
resolved "https://registry.yarnpkg.com/@ianwalter/cli/-/cli-1.1.0.tgz#e1ff4891f66ce4434334202324db2a741737ab0c"
152+
integrity sha512-5TCm24OMevpcfP4+q7w7ckI7lpfMzq/uI17hoq6THuLUmL7tmjlpW4YM+uEURBAQEzT08RMtMMyIBY4ZRZHCnQ==
152153
dependencies:
154+
dot-prop "^5.0.0"
153155
getopts "^2.2.4"
154156
pkg-conf "^3.1.0"
155157
yargs "^13.2.2"
@@ -1174,6 +1176,11 @@ dot-prop@^5.0.0:
11741176
dependencies:
11751177
is-obj "^1.0.0"
11761178

1179+
dotenv@^7.0.0:
1180+
version "7.0.0"
1181+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-7.0.0.tgz#a2be3cd52736673206e8a85fb5210eea29628e7c"
1182+
integrity sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==
1183+
11771184
duplexer3@^0.1.4:
11781185
version "0.1.4"
11791186
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"

0 commit comments

Comments
 (0)