Git Product home page Git Product logo

jasmine-boilerplate's Introduction

Jasmine Boilerplate CI

Boilerplate project to run WebdriverIO tests with Jasmine using latest ES2016 features and the page objects pattern.

Quick Start

Choose one of the following options:

  1. Download the latest stable release here or clone the git repo โ€” git clone https://github.com/webdriverio/jasmine-boilerplate.git

  2. Then copy the files to your project directory (all files in /test and the wdio.*.conf.js)

  3. Merge project dev dependencies with your projects dev dependencies in your package.json

Features

jasmine-boilerplate's People

Contributors

christian-bromann avatar dependabot-preview[bot] avatar dependabot[bot] avatar dksoni812 avatar seanpoulter avatar wswebcreation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jasmine-boilerplate's Issues

Bug: jasmineNodeOpts: should be jasmineOpts: to allow "defaultTimeoutInterval" to be active

jasmineNodeOpts: {
    // Jasmine default timeout
    defaultTimeoutInterval: 60000,

}

Leaves the timeout at default 10 seconds, not 1 minute, generating this message for any test over ten seconds.
Error: Timeout - Async function did not complete within 10000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)

Probable cause for this error:
Error: Couldn't find page handle error.
when commands are sent against the browser after it's been closed.

Change to jasmineOpts: to allow Jasmine to execute tests longer than 10 seconds

    jasmineOpts: {
        // Jasmine default timeout
        defaultTimeoutInterval: 60000,
}

Broken type recognition for 'describe'

Steps to reproduce:

  1. Clone the project
  2. Open on the main branch
  3. Use npm install

Result:

Typescript error on each 'describe':
Cannot find name 'describe'. Do you need to install type definitions for a test runner? Trynpm i --save-dev @types/jestornpm i --save-dev @types/mochaand then add 'jest' or 'mocha' to the types field in your tsconfig.

The funny thing is I have built a project based on that boilerplate and solved that problem, but now I can not reproduce the fix that I wanted to introduce here, that's why I am raising this.
Edit: Adding @types/jasmine to dependencies solves the issue but I guess that's not the way to go...

Using the github actions yml file example in this project I get the following error...

WARN webdriver: Request failed with status 500 due to Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.

Followed by

ERROR webdriver: Request failed with status 500 due to WebDriver Error: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.
[0-1]   (unknown error: DevToolsActivePort file doesn't exist)

Is the yml file outdated or am I missing a key component?

Boilerplate example doesn't connect to Sauce Labs

After cloning this boilerplate example, I add my Sauce Labs user and API key to wdio.sauce.conf.ts file. When I run npm run test, the tests fail (they do pass locally).

If I check the logs, wdio.log shows:

2021-06-17T16:26:10.773Z DEBUG @wdio/utils:initialiseServices: initialise service "sauce" as NPM package
2021-06-17T16:26:11.037Z INFO @wdio/cli:launcher: Run onPrepare hook
2021-06-17T16:26:11.037Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 0ms
2021-06-17T16:26:11.041Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2021-06-17T16:26:11.042Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2021-06-17T16:26:11.042Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2021-06-17T16:26:11.042Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2021-06-17T16:26:11.042Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2021-06-17T16:26:11.042Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2021-06-17T16:26:11.052Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,wdio.sauce.conf.ts
2021-06-17T16:26:11.151Z INFO @wdio/local-runner: Start worker 0-1 with arg: run,wdio.sauce.conf.ts
2021-06-17T16:26:11.246Z INFO @wdio/local-runner: Start worker 0-2 with arg: run,wdio.sauce.conf.ts
2021-06-17T16:26:17.861Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
2021-06-17T16:26:18.012Z DEBUG @wdio/local-runner: Runner 0-1 finished with exit code 1
2021-06-17T16:26:18.163Z DEBUG @wdio/local-runner: Runner 0-2 finished with exit code 1
2021-06-17T16:26:18.164Z INFO @wdio/cli:launcher: Run onComplete hook
2021-06-17T16:26:18.165Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 0ms
2021-06-17T16:26:18.197Z INFO @wdio/local-runner: Shutting down spawned worker
2021-06-17T16:26:18.448Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully

If I check the logs, wdio-0-0.log:

2021-06-17T16:26:14.545Z INFO @wdio/local-runner: Run worker command: run
2021-06-17T16:26:15.465Z DEBUG @wdio/config:utils: Found 'ts-node' package, auto-compiling TypeScript files
2021-06-17T16:26:15.725Z DEBUG @wdio/local-runner:utils: init remote session
2021-06-17T16:26:15.750Z DEBUG @wdio/utils:initialiseServices: initialise service "sauce" as NPM package
2021-06-17T16:26:16.149Z DEBUG @wdio/sync: Finished to run "beforeSession" hook in 0ms
2021-06-17T16:26:16.599Z DEBUG @wdio/local-runner:utils: init remote session
2021-06-17T16:26:16.602Z INFO webdriver: Initiate new session using the WebDriver protocol
2021-06-17T16:26:16.605Z INFO webdriver: [POST] https://hub.testingbot.com/wd/hub/session
2021-06-17T16:26:16.605Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'Windows 10',
      'sauce:options': [Object]
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    browserVersion: 'latest',
    platformName: 'Windows 10',
    'sauce:options': { build: 'Build 1623947171' }
  }
}
2021-06-17T16:26:17.304Z WARN webdriver: Request failed with status 401 due to The key (username) and secret (apikey) you used to authenticate are incorrect TestingBot credentials
2021-06-17T16:26:17.305Z INFO webdriver: Retrying 1/3
2021-06-17T16:26:17.305Z INFO webdriver: [POST] https://hub.testingbot.com/wd/hub/session
2021-06-17T16:26:17.305Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      browserName: 'chrome',
      browserVersion: 'latest',
      platformName: 'Windows 10',
      'sauce:options': [Object]
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    browserName: 'chrome',
    browserVersion: 'latest',
    platformName: 'Windows 10',
    'sauce:options': { build: 'Build 1623947171' }
  }
}

2021-06-17T16:26:17.752Z ERROR webdriver: Request failed with status 401 due to Error: The key username) and secret (apikey) you used to authenticate are incorrect TestingBot credentials
2021-06-17T16:26:17.752Z ERROR webdriver: Error: The key username) and secret (apikey) you used to authenticate are incorrect TestingBot credentials

So, why is this trying to connect to TestingBot when it should be connecting to Sauce Labs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.