6.0.8 ā€¢ Published 2 years ago

@gliff-ai/jest-browserstack-automate v6.0.8

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
2 years ago

gliff.ai test jest-browserstack-automate

Repo License Repository Size Latest Tag Number of Open Issues Number of Open Pull Requests

šŸ‘‹ Welcome in! šŸ‘‹

This repository contains the Open Source code for gliff.aiā€™s Browserstack Automate tests using Jest.

This test repository aims to create vital tests which help catch any technical or visual breakages in the code or performance and alert the gliff.ai team. This simple test harness is a collection of stubs, driver and other support tools that enables Browserstack Automate tests to be run with Jest and generate a test report.

āŒ This repository does not accept most contributions unfortunately! However, an issue can still be raised if you recognise a problem you wish to bring to the gliff.ai teams attention. āŒ

Table of Contents

Looking for something specific? šŸ”

Setup

{{back to navigation}}

Below is the wrapper you should use to setup BrowerStack and run Selenium tests using Jest.

// Replaces the Jest global `test` with our function, which has a selenium driver as an arg. This handles sending pass/failure status to Browserstack.
const {
  wrapper,
  test,
  webdriver,
} = require("@gliff-ai/jest-browserstack-automate")();

const { TARGET_URL = "http://localhost:3000/" } = process.env;

// Wrappper is a jest describe with before/after hooks to setup browserstack and the local tunnel
wrapper(() => {
  describe("Load page", () => {
    test("Loads the page", async (driver, percySnapshot) => {
      await driver.get(TARGET_URL);

      await driver.wait(webdriver.until.titleMatches(/Title/i), 5000);
      const title = await driver.getTitle();

      expect(title).toEqual("PAGE TITLE");
    });
  });
});

run with jest --no-colors as we send the message to browserstack so don't want the colour codes.

NOTE: \ If no env vars are set, it will run locally, you will need the driver installed for the selected browser. \ If BROWSERSTACK_NAME is set, it will use Browserstack for the driver (capabilities can be passed as the final arg to test). \ If BROWSERSTACK_ACCESS_KEY is set, the Browserstack local proxy will be set up, which allows the use of local URLs. \

Below is the additonal wrapper you should use to setup Percy.

The second argument passed to test is a wrapper for percySnapshot that will create only 1 snapshot rather than 1 for each browser (import the original from "@percy/selenium-webdriver" to create a snapshot for every browser)

PERCY_TOKEN=xxxx percy exec -- jest --no-colors

Contribute

{{back to navigation}}

This repository does not accept contributions unfortunately as content has been developed with specific gliff.ai team practises and preferences in mind. However, an issue can still be raised if you recognise a problem you wish to bring to the gliff.ai teams attention.

We do have several repositories within the gliff.ai github space that welcome all contributions and contributors on. These will be marked with the topic tag contributions-welcome meaning we welcome contributions on this repository! Search for them here!

Check out the gliff.ai Contribution Guide šŸ‘‹ to learn more!

Contact

{{back to navigation}}

Need some help? šŸ¤” Have a question? šŸ§  \ Reach out to the gliff.ai team at community@gliff.ai or on our GitHub discussions.

License

{{back to navigation}}

This code is licensed under a GNU AGPLv3 license šŸ“ \ Curious about our reasoning for this? Read about them here!

6.0.7

2 years ago

6.0.6

2 years ago

6.0.8

2 years ago

5.2.8

2 years ago

5.2.7

2 years ago

5.2.6

2 years ago

5.2.5

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.3

2 years ago

6.0.2

2 years ago

6.0.5

2 years ago

6.0.4

2 years ago

5.2.4

2 years ago

5.2.3

2 years ago

5.2.2

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.11

2 years ago

5.0.6

2 years ago

5.0.5

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.10

2 years ago

5.0.9

2 years ago

5.0.8

2 years ago

5.0.7

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago