npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@telus/telus-nightwatch-commands

v2.12.1

Published

Nightwatch custom commands for Telus Digital

Downloads

91

Readme

Telus Nightwatch Commands

version

Nightwatch custom commands for Telus Digital

Setup

This library was generated with @telus/create-library. In order for your library to handle version management and releases automatically, please make sure you set up the NPM_TOKEN inside the Github actions workflow, following the instructions here.

Install

npm install @telus/telus-nightwatch-commands

Configure your E2E Environment

In nightwatch.conf.js, modify the CUSTOM_COMMANDS and CUSTOM_ASSERTIONS value to include the Telus nightwatch custom commands, ie

const CUSTOM_COMMANDS = [
  path.join(__dirname, 'node_modules', '@telus/nightwatch-visual', 'commands'),
  path.join(__dirname, 'node_modules', '@telus/telus-nightwatch-commands', 'commands')
]
const CUSTOM_ASSERTIONS = [
  path.join(__dirname, 'node_modules', '@telus/nightwatch-visual', 'assertions'),
  path.join(__dirname, 'node_modules', '@telus/telus-nightwatch-commands', 'assertions')
]

And set the environment variable accessibilityTestingEnabled to true

  test_settings: {
    default: {
      globals: {
        accessibilityTestingEnabled: true
      }
    }
  }

Use the commands in your E2E Tests

  1. To call the login method from your test code, pass in the url for loginUrl from any authenticated page as the follows:
    browser.url('https://www.telus.com/my-telus') // example url, visit any authenticated page on Telus.
    browser.url((response) => {
      const loginUrl = response.value
      browser.login({
        username,
        password,
        returnUrl: 'https://www.telus.com/my-telus', // example url, use the page url you want to visit after login action
        loginUrl,
        oauthCookie: 'oauthCookieName', // environment specific, see note below.
        sessionCookie: 'sessionCookieName',
        isDevelopment: false // set to true is run locally
      })
    })

Note: oauth and session cookie names are specific to the environment you're trying to log into.

Environment | Value ------------ | ------------- Staging| oauthCookie = 'OAuth2TokenStage' sessionCookie = 'SessionTokenStage' Production | oauthCookie = 'OAuth2Token' sessionCookie = 'SessionToken'

  1. To call the Accessibility scan from your test code, call the command when the driver is on a page as the follows:
    browser
      .url(url, () => {
        browser.assert.urlEquals(url)
      })
      .accessibility({
        pageName: 'Hello World',
        root: '#app',
        rules: {
          'color-contrast': { enabled: true }
        },
        runOnly: {
          type: "tag",
          values: ["wcag2a", "wcag2aa"]
        },
        verbose: false,
        timeout: 5000
      })

Note: None of the parameters are mandatory, the command can be called like this:

    browser.accessibility()
  1. To use the custom console log command, call the command as the follow:
    browser.log('Successfully logging a message.')
  1. To use the custom removeMyTelusSurvey command, call the command as follows:
    browser.removeMyTelusSurvey()
  1. To use the getOneTimePasscode command, call the command as follows:
    const rackspaceAuthentication = {
      user: `${process.env.RACKSPACE_USER}`,
      pass: `${process.env.RACKSPACE_PASS}`
    }
    browser.getOneTimePasscode(rackspaceAuthentication, (result) => {
      browser.log(`One Time Passcode is ${result.value}`)
    })

Note: Environment variables can be set locally by executing set-env.sh script. Need for such a shippy-user access with a read policy from any My TELUS tribe.

Note: Environment can be set in an Openshift project by using the standard method used in the my-telus-e2e project.

  1. To use the restoreDevice command, call the command from any authenticated page as follows:
    browser.restoreDevice({
      ban,
      sub
    })
  1. To use the changeEmail command, call the command from any authenticated page as follows:
    browser.changeEmail('newEmail')
  1. To use the setBillFormat command, call the command from any authenticated page as follows:
    browser.changeEmail({
      ban,
      emailAddress
    })

Github: @telus • Twitter: @telusdigital