Skip to content

awls99/go-ground-challenge

Repository files navigation

After cloning the repo

  • run the command npm install.

To execute the tests locally

** Important: ** Included drivers in ./drivers are for MacOS Intel CPU, you might need to download different drivers if using different OS or arch.

  • Expose ./drivers into path export PATH=$PATH:[PATH_TO_PROJECT]/drivers

    • It might be that you'll need to update these drivers if using more recent versions Chrome or Firefox, just download them and place them on the drivers folder and it should work. (During development chromedriver 97.0.4692.71 was used with a compatible Chrome 97 build and Geckodriver v 0.30.0 with Firefox 96.0.1)
  • run the command npm test.

Chosing Browser

export browser=[chrome|firefox] Can also edit set-enviroment-variables.ts for development. The code defaults to Chrome.

To choose a reporter

The last reporter/formatter found on the cucumber-js command-line wins:

--format summary --format @cucumber/pretty-formatter --format cucumber-console-formatter

In package.json file, modify the cucumber script to keep only your preferred formatter.

To debug a scenario in Visual Studio Code

  • tag the scenario with @debug
  • set the breakpoints in the typescript code
  • Start debugging

To run only specific scenarios

  • tag the scenario(s) with @only
  • run the command npm run only.

To ignore a scenario

  • tag the scenario with @ignore

To check for typescript, linting and gherkin errors

  • run the command npm run build.

To view the steps usage

  • run the command npm run steps-usage.

To view the html report of the last run

  • run the command npm run report.

To create a new step

  • first write the Given/When/Then sentence:

    Given I push "foo" on "bar"
  • run the npm script:

    npm run snippets
  • the script will report the missing step(s): you just need to copy and paste them in the step definitions file:

    Given('I push {string} on {string}', async function (string, string2) {
      // Write code here that turns the phrase above into concrete actions
      return 'pending';
    });

To use a custom option on the CLI

With cucumber-js v7, you cannot have anymore custom options on the CLI. This is a breaking change with cucumber-js v6.

You must instead use environment variables.

When running your tests localy, you can setup environment variables by customizing the file set-environment-variables.ts.

When running on a CI, you should setup your jobs with the expected environment variables.

To use a custom World Objet

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published