From a911c69b03769d24aff2b30e05bd2b9646434a3b Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Fri, 10 May 2019 18:12:48 +0530 Subject: [PATCH 01/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e99666..18325fa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "wdio-browserstack-service": "^0.1.16", "wdio-dot-reporter": "0.0.10", "wdio-mocha-framework": "^0.6.3", - "webdriverio": "^4.13.2", + "webdriverio": "5.8.3", "wdio-browserstack-reporter": "~0.1.0" } } From 53a3b09114657eb95e928fed4488509e061f2e38 Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Mon, 13 May 2019 19:43:44 +0530 Subject: [PATCH 02/11] Update wdio.conf.js --- wdio.conf.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/wdio.conf.js b/wdio.conf.js index ef9e848..e5d9df6 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -61,8 +61,6 @@ exports.config = { 'browserName': 'Chrome', 'browser_version': '62.0', 'resolution': '1024x768', - 'browserstack.local': true, - // "browserstack.geoLocation": 'US', 'project': 'Sample WDIO test', 'build': 'Sample WDIO test v1', }], @@ -132,7 +130,6 @@ exports.config = { // your test setup with almost no effort. Unlike plugins, they don't add new // commands. Instead, they hook themselves up into the test process. services: ['browserstack'], - browserstackLocal: true, // // Framework you want to run your specs with. // The following are supported: Mocha, Jasmine, and Cucumber From 19d12330df2cdbbd4f0f43c4155d01cb8220f225 Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Mon, 13 May 2019 19:44:49 +0530 Subject: [PATCH 03/11] Update spec0.js --- test/specs/spec0.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/specs/spec0.js b/test/specs/spec0.js index f7e0cb7..11cedb0 100644 --- a/test/specs/spec0.js +++ b/test/specs/spec0.js @@ -2,10 +2,8 @@ var assert = require('assert'); describe('webdriver.io page', function() { it('should have the right title - the fancy generator way', function () { - // browser.url('http://www.whatsmyip.org/') - // browser.pause(5000); browser.url('http://webdriver.io'); var title = browser.getTitle(); - assert.equal(title, 'WebdriverIO - WebDriver bindings for Node.js'); + assert.equal(title, 'WebdriverIO · Next-gen WebDriver test framework for Node.js'); }); -}); \ No newline at end of file +}); From 58906eded7814c45104f55e6ea6987ec6776d0d5 Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Tue, 14 May 2019 15:16:58 +0530 Subject: [PATCH 04/11] Adding changes specific to WDIO5 --- wdio.conf.js | 137 +++++++++++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 58 deletions(-) diff --git a/wdio.conf.js b/wdio.conf.js index e5d9df6..7a77ead 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -1,5 +1,26 @@ exports.config = { - + // + // ==================== + // Runner Configuration + // ==================== + // + // WebdriverIO allows it to run your tests in arbitrary locations (e.g. locally or + // on a remote machine). + runner: 'local', + // + // ===================== + // Server Configurations + // ===================== + // Host address of the running Selenium server. This information is usually obsolete as + // WebdriverIO automatically connects to localhost. Also, if you are using one of the + // supported cloud services like Sauce Labs, Browserstack, or Testing Bot you don't + // need to define host and port information because WebdriverIO can figure that out + // according to your user and key information. However, if you are using a private Selenium + // backend you should define the host address, port, and path here. + // + hostname: 'hub.browserstack.com', + port: 443, + path: '/wd/hub', // // ================= // Service Providers @@ -8,9 +29,13 @@ exports.config = { // should work too though). These services define specific user and key (or access key) // values you need to put in here in order to connect to these services. // - user: process.env.BROWSERSTACK_USERNAME, - key: process.env.BROWSERSTACK_ACCESS_KEY, - + user: process.env.BROWSERSTACK_USER, + key: process.env.BROWSERSTACK_ACCESSKEY, + // + // If you run your tests on SauceLabs you can specify the region you want to run your tests + // in via the `region` property. Available short handles for regions are `us` (default) and `eu`. + // These regions are used for the Sauce Labs VM cloud and the Sauce Labs Real Device Cloud. + // If you don't provide the region it will default for the `us` // // ================== @@ -56,13 +81,11 @@ exports.config = { // 5 instances get started at a time. maxInstances: 5, // - 'os': 'Windows', - 'os_version': '10', - 'browserName': 'Chrome', - 'browser_version': '62.0', - 'resolution': '1024x768', - 'project': 'Sample WDIO test', - 'build': 'Sample WDIO test v1', + browserName: 'firefox', + // If outputDir is provided WebdriverIO can capture driver session logs + // it is possible to configure which logTypes to include/exclude. + // excludeDriverLogs: ['*'], // pass '*' to exclude all driver session logs + // excludeDriverLogs: ['bugreport', 'server'], }], // // =================== @@ -70,32 +93,32 @@ exports.config = { // =================== // Define all options that are relevant for the WebdriverIO instance here // - // By default WebdriverIO commands are executed in a synchronous way using - // the wdio-sync package. If you still want to run your tests in an async way - // e.g. using promises you can set the sync option to false. - sync: true, - // - // Level of logging verbosity: silent | verbose | command | data | result | error - logLevel: 'silent', - // - // Enables colors for log output. - coloredLogs: true, + // Level of logging verbosity: trace | debug | info | warn | error | silent + logLevel: 'info', // - // Warns when a deprecated command is used - deprecationWarnings: true, + // Set specific log levels per logger + // loggers: + // - webdriver, webdriverio + // - @wdio/applitools-service, @wdio/browserstack-service, @wdio/devtools-service, @wdio/sauce-service + // - @wdio/mocha-framework, @wdio/jasmine-framework + // - @wdio/local-runner, @wdio/lambda-runner + // - @wdio/sumologic-reporter + // - @wdio/cli, @wdio/config, @wdio/sync, @wdio/utils + // Level of logging verbosity: trace | debug | info | warn | error | silent + // logLevels: { + // webdriver: 'info', + // '@wdio/applitools-service': 'info' + // }, // // If you only want to run your tests until a specific amount of tests have failed use // bail (default is 0 - don't bail, run all tests). bail: 0, // - // Saves a screenshot to a given path if a command fails. - screenshotPath: './errorShots/', - // // Set a base URL in order to shorten url command calls. If your `url` parameter starts // with `/`, the base url gets prepended, not including the path portion of your baseUrl. // If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url // gets prepended directly. - baseUrl: '', + baseUrl: 'http://localhost', // // Default timeout for all waitFor* commands. waitforTimeout: 10000, @@ -107,24 +130,6 @@ exports.config = { // Default request retries count connectionRetryCount: 3, // - // Initialize the browser instance with a WebdriverIO plugin. The object should have the - // plugin name as key and the desired plugin options as properties. Make sure you have - // the plugin installed before running any tests. The following plugins are currently - // available: - // WebdriverCSS: https://github.com/webdriverio/webdrivercss - // WebdriverRTC: https://github.com/webdriverio/webdriverrtc - // Browserevent: https://github.com/webdriverio/browserevent - // plugins: { - // webdrivercss: { - // screenshotRoot: 'my-shots', - // failedComparisonsRoot: 'diffs', - // misMatchTolerance: 0.05, - // screenWidth: [320,480,640,1024] - // }, - // webdriverrtc: {}, - // browserevent: {} - // }, - // // Test runner services // Services take over a specific job you don't want to take care of. They enhance // your test setup with almost no effort. Unlike plugins, they don't add new @@ -133,28 +138,36 @@ exports.config = { // // Framework you want to run your specs with. // The following are supported: Mocha, Jasmine, and Cucumber - // see also: http://webdriver.io/guide/testrunner/frameworks.html + // see also: https://webdriver.io/docs/frameworks.html // // Make sure you have the wdio adapter package for the specific framework installed // before running any tests. framework: 'mocha', // + // The number of times to retry the entire specfile when it fails as a whole + // specFileRetries: 1, + // // Test reporter for stdout. // The only one supported by default is 'dot' - // see also: http://webdriver.io/guide/reporters/dot.html - reporters: ['browserstack'], - reporterOptions: { - browserstack: { - outputDir: './' - } - }, + // see also: https://webdriver.io/docs/dot-reporter.html + reporters: ['dot'], + + // reporters: ['browserstack'], + // reporterOptions: { + // browserstack: { + // outputDir: './' + // } + // }, // // Options to be passed to Mocha. // See the full list at http://mochajs.org/ mochaOpts: { - ui: 'bdd' + ui: 'bdd', + timeout: 60000 }, + + // // ===== // Hooks @@ -214,13 +227,13 @@ exports.config = { // beforeHook: function () { // }, /** - * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling + * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling * afterEach in Mocha) */ // afterHook: function () { // }, /** - * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends. + * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts. * @param {Object} test test details */ // afterTest: function (test) { @@ -263,7 +276,15 @@ exports.config = { * @param {Object} exitCode 0 - success, 1 - fail * @param {Object} config wdio configuration object * @param {Array.} capabilities list of capabilities details + * @param {} results object containing test results */ - // onComplete: function(exitCode, config, capabilities) { - // } + // onComplete: function(exitCode, config, capabilities, results) { + // }, + /** + * Gets executed when a refresh happens. + * @param {String} oldSessionId session ID of the old session + * @param {String} newSessionId session ID of the new session + */ + //onReload: function(oldSessionId, newSessionId) { + //} } From de6d8db509bd4064a10f28d60c141a45487af21b Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Tue, 14 May 2019 15:18:09 +0530 Subject: [PATCH 05/11] Adding dependencies for WDIO5 --- package.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 18325fa..23edf4b 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,13 @@ "author": "Ashwin G", "license": "ISC", "devDependencies": { - "wdio-browserstack-service": "^0.1.16", - "wdio-dot-reporter": "0.0.10", - "wdio-mocha-framework": "^0.6.3", - "webdriverio": "5.8.3", - "wdio-browserstack-reporter": "~0.1.0" + "@wdio/browserstack-service": "^5.8.0", + "@wdio/cli": "^5.8.3", + "@wdio/dot-reporter": "^5.7.8", + "@wdio/local-runner": "^5.8.3", + "@wdio/mocha-framework": "^5.8.1", + "@wdio/sync": "^5.8.1", + "wdio-browserstack-reporter": "^0.1.1", + "webdriverio": "^5.8.3" } } From f3cf910bcd6c03450cd2f71739c531a36f815b8c Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Tue, 14 May 2019 15:18:50 +0530 Subject: [PATCH 06/11] Update spec0.js --- test/specs/spec0.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/specs/spec0.js b/test/specs/spec0.js index 11cedb0..3abc984 100644 --- a/test/specs/spec0.js +++ b/test/specs/spec0.js @@ -1,9 +1,9 @@ -var assert = require('assert'); +const assert = require('assert'); -describe('webdriver.io page', function() { - it('should have the right title - the fancy generator way', function () { - browser.url('http://webdriver.io'); - var title = browser.getTitle(); +describe('webdriver.io page', () => { + it('should have the right title', () => { + browser.url('https://webdriver.io'); + const title = browser.getTitle(); assert.equal(title, 'WebdriverIO · Next-gen WebDriver test framework for Node.js'); }); }); From b67b2b84b586ac92fd75bd793864b67f4627ff65 Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Tue, 14 May 2019 15:19:18 +0530 Subject: [PATCH 07/11] Delete .DS_Store --- test/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/.DS_Store diff --git a/test/.DS_Store b/test/.DS_Store deleted file mode 100644 index 29e5f6395bd2e0c47a9bcfe6cf6dc70368fcbb64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOG*Pl5UtV#0&cQ&*;mL7nlLV0=K_)$(Zz%rh}mS-XL0EX+<6QS;sNy4N0}jm z8$m>>p!!wUr@QCD^oNLeeP~uhOCnl81zC&<5%*;1%#-Ip)-m?iZC7vGZaXo|-*m~^ z=d`DuZmFi>`h}7s^z~gump{mC?^c_-+x6 Date: Tue, 14 May 2019 15:19:38 +0530 Subject: [PATCH 08/11] Delete DS_Store --- DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 DS_Store diff --git a/DS_Store b/DS_Store deleted file mode 100644 index e4dd068f0c132768b86925dc12e5350de6ede183..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHM%Wl&^6unadIH4t`EfiRQQN?3Xs)U!25F!des6x<+RM4tGu;XcJusy+c8cHe3 z28j<~1sgUXvEUn!SR(dFEcgNzNNm`_ok!9(B?~qP#Edj^u4nGKo;l9gz77D8V#Cb? z>;?b>D@Su1Hoqu*oYxJdPxTBS666C^AOHp~G{E2Btvj>=S^=$qRzNGD75Ezzz-Klu zMvv#d9M!E>Kr8THD!}g#7FLc0g)NEV)`5*k0T5HzEehJ02MCU(u%NIdQBX0a%pQoM z5|v^QNyl-EyCW79wj@eA5J?B3&P-H>Ld4mTX9;&81&O-V3TOp3D!_C1eh5X@PS@q{ z6ygb=RUMx>=)#n;`?;;g*Pov}?iI&r#&xyQ_fFmS;v|>*NcuLV zHgDN#7#Slokhxi2V9j!3CylshM|1pW%1#y>WluBacWm3a=Fw)w96ry&#P&iO39{!> zbh&Ze3tiSMvPS5}B2HNj7)IJiSIj-j%O_8t8ng1Jaw}uja{kzf+?aLp__39hv@vop ze|F+_u=HU0;mV_DxEd@(-4Y=yk2~#iv^q+7)kU>J^0>Xi&+QeaGu!$Hwr9;9*}?44 z(D2S(BO`k%=8$7o@75wd&-2V@QPFSE8L!I1viE?_B=mm5jfy$g<#(03w^qBRm+I&< zyxJjRU5qFV=W3DXPR`HAG?`gr&)$ep+=+w+6X86=_=_m!WIgd%7+<4Nj5upYksa1( zap|USJJg>Hi!4c4P%*QDi<6v+DCdc|<+@$tDspK}2D!|8YZ(qJTy_Od+x93=Wp?A#1auoV3 ztYIuZzkX=qM>`KU>^N>;+_o@}7H;9L?eh(N*W3V*DxSiK`uUI2=%N+)mlW6}C%c>H z{}+0H|Nobkr01#?&C&vH) From a166a32702a56742d9cf373bacf227dc5afef35e Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Tue, 14 May 2019 15:20:22 +0530 Subject: [PATCH 09/11] Update wdio.conf.js --- wdio.conf.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wdio.conf.js b/wdio.conf.js index 7a77ead..51a14f7 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -150,14 +150,14 @@ exports.config = { // Test reporter for stdout. // The only one supported by default is 'dot' // see also: https://webdriver.io/docs/dot-reporter.html - reporters: ['dot'], +// reporters: ['dot'], - // reporters: ['browserstack'], - // reporterOptions: { - // browserstack: { - // outputDir: './' - // } - // }, + reporters: ['browserstack'], + reporterOptions: { + browserstack: { + outputDir: './' + } + }, // // Options to be passed to Mocha. From 5a9aeacdf5ab2be8f999d11e994132221183f36d Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Wed, 11 Sep 2019 16:44:20 +0530 Subject: [PATCH 10/11] Update package.json Adding updated package for wdio-browserstack-reporter --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23edf4b..a42423a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@wdio/local-runner": "^5.8.3", "@wdio/mocha-framework": "^5.8.1", "@wdio/sync": "^5.8.1", - "wdio-browserstack-reporter": "^0.1.1", + "wdio-browserstack-reporter": "browserstack/wdio-browserstack-reporter#wdio5", "webdriverio": "^5.8.3" } } From 6df6d47ea2bc216e61a3a430aa85bbe8967484bb Mon Sep 17 00:00:00 2001 From: Ashwin Gonsalves Date: Thu, 18 Jun 2020 22:02:06 +0530 Subject: [PATCH 11/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a42423a..8ae31ad 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@wdio/local-runner": "^5.8.3", "@wdio/mocha-framework": "^5.8.1", "@wdio/sync": "^5.8.1", - "wdio-browserstack-reporter": "browserstack/wdio-browserstack-reporter#wdio5", + "wdio-browserstack-reporter": "git+https://github.com/browserstack/wdio-browserstack-reporter.git#wdio5", "webdriverio": "^5.8.3" } }