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

qms-automation-testing-2

v1.23.2

Published

- Pull the latest code from the repository ``` git pull ``` - Add all code to staged (to push code to repository) ``` git add . ``` - Push code to repository ``` git push ```

Downloads

2

Readme

git

  • Pull the latest code from the repository
git pull
  • Add all code to staged (to push code to repository)
git add .
  • Push code to repository
git push

Docs

Chemical - Documentation


Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Chemical-db

e2e site

https://backend.chemical-db.e2e.qms.netpower.cloud/

  • Run all test cases
npm run e2e-chemical-db-e2e
  • Run the specific test case
npm run e2e-chemical-db-e2e-dev

Staging site

https://backend.chemical-db.qms.netpower.cloud/

  • Run all test cases
npm run e2e-chemical-db-staging
  • Run the specific test case
npm run e2e-chemical-db-staging-dev

dev site

http://backend.dev.qms.netpower.cloud/

  • Run all test cases
npm run e2e-chemical-db-dev
  • Run the specific test case
npm run e2e-chemical-db-dev-dev

Deviation

qc site

http://deviation.qc.qms.netpower.cloud/

  • Run all test cases
npm run e2e-deviation-qc
  • Run the specific test case
npm run e2e-deviation-qc-dev

backend qc site

http://backend.qc.qms.netpower.cloud/deviation/

  • Run all test cases
npm run e2e-deviation-backend-qc
  • Run the specific test case
npm run e2e-deviation-backend-qc-dev

Risk

qc site

http://backend.qc.qms.netpower.cloud/rm

  • Run all test cases
npm run e2e-risk-backend-qc
  • Run the specific test case
npm run e2e-risk-backend-qc-dev

Process

backend-staging

http://backend.process.qms.netpower.cloud/

  • Run all test cases
npm run e2e-process-backend-staging
  • Run the specific test case
npm run e2e-process-backend-staging-dev

staging

http://handbook.process.qms.netpower.cloud/

  • Run all test cases
npm run e2e-process-staging
  • Run the specific test case
npm run e2e-process-staging-dev

Methods

Click

Click to element

  1. clickById(id, itemNumber = 1)

    • itemNumber: 1-n (position of array element)
    • Ex:
      await page.clickById('#submit-button')
      await page.clickById('#submit-button', 2)
  2. clickByName(name, itemNumber = 1)

    • itemNumber: 1-n (position of array element)
    • Ex:
      await page.clickByName('submitButton')
      await page.clickByName('submitButton', 2)
  3. clickBySelector(name, itemNumber = 1)

    • itemNumber: 1-n (position of array element)
    • Ex:
      await page.clickBySelector('#submit-button')
      await page.clickBySelector('btn-loading[name="submitButton"]', 2)
  4. clickByCssSelector(selectorClass)

    • Ex:
      await page.clickByCssSelector('#sidebarContent > div.left-content_add_button.ng-star-inserted > app-button > button', 5000);
  5. clickByXPath(path)

    • Ex: '/html/body/app-root/mat-sidenav-container/mat-sidenav-content/div/div/app-risk/div/div[1]/div[2]/div[3]/mat-form-field/div/div[1]/div'
      await page.clickByCssSelector('/html/body/app-root...');

Click to item in select

  1. clickItemPositionInSelectorControlById(optionId, position)

    • optionId: id of element item in select control
    • position: position of selected element in list (1-n)
    • Ex:
      await page.clickItemPositionInSelectorControlById('sorter-option', 2);
  2. clickItemPositionInSelectorControlByName(optionName, position)

    • optionName: name of element item in select control
    • position: position of selected element in list (1-n)
    • Ex:
      await page.clickItemPositionInSelectorControlByName('sorterOption', 2);
  3. clickItemValueInSelectorControlById(optionId, value)

    • optionId: id of element item in select control
    • value: value text of selected element in list
    • Ex:
      await page.clickItemValueInSelectorControlById('sorter-option', 'Name Z - A');
  4. clickItemValueInSelectorControlByName(optionName, value)

    • optionName: name of element item in select control
    • value: value text of selected element in list
    • Ex:
      await page.clickItemValueInSelectorControlByName('sorterOption', 'Name Z - A');

Wait for loaded

  1. waitForTableShownById(id: string, expectedNumber: number, timeout = 10000)

    • id: id of table element
    • expectedNumber: number of row in table
    • timeout: default = 10s
    • Ex:
      await page.waitForTableShownById('sds-list-table', 10);
  2. waitForTableShownBySelector(selector: string, expectedNumber: number, timeout = 10000)

    • expectedNumber: number of row in table
    • timeout: default = 10s
    • Ex:
      await page.waitForTableShownBySelector('#pdf-viewer-left div.ng2-pdf-viewer-container div.pdfViewer div.page', 10, 10000);
  3. waitForSelectorHavingContent(selector: string, timeout = 10000)

  4. waitForSelectorHavingHref(selector: string, timeout = 10000)

  5. waitForFileExisted(fileName: string, timeout = 10000)

Field Input

  1. sendKeysById(id: string, value: string)
  2. sendKeysByName(name: string, value: string)
  3. sendKeysByXPath(xpath: string, value: string)
  4. sendKeys(selector: string, text = '', timeout = 5000)

Table

  1. getBodyColumnTextInTableBySelector(selector: string, rowNumber = 1, colNumber = 1)

    • Get text of td element in a table
    • rowNumber: 1-n
    • colNumber: 1-n

Scroll

  1. scrollInElementById(id: string, height: number)
  2. scrollToPositionByOptionId(optionId: string, position: number)
  3. scrollToPositionByName(name: string, position: number)
  4. scrollToElementById(id: string)
  5. scrollBy(height: number)

Working with files

  1. deleteAlreadyDownloadedFiles(fileName: string)

    • Base folder: variable DOWNLOAD_FOLDER in .env file
  2. verifyFileExisted(fileName: string)

    • Base folder: variable DOWNLOAD_FOLDER in .env file
  3. waitForFileExisted(fileName: string, timeout = 10000)

expect methods

  1. expectText(val1: string, val2: string)

  2. expectEqual(val1: any, val2: any)

  3. expectNotEqual(val1: any, val2: any)

    • mustHaveContent(value: string)
    • Check page has content which contains value.

Console Log

  1. printTextById(id: string)

    • printTextByXPath(path: string)
    • printTextBySelector(selector: string)

Set up new site

Ex: Set up backend-qc site for Handbook

url: http://backend.qc.qms.netpower.cloud/

  1. Create folder e2e/src/hanbook/backend to contain test case files.

  2. Create 2 files

    • e2e/protractor.conf.handbook.backend.js to run all test cases
    • e2e/protractor.conf.handbook.backend.dev.js to run specific test case
  3. In protractor file, change baseUrl and specs variables.

  4. In angular/json file, create new project for handbook-backend (the same with chemical-db and deviation)

    • create new configurations: qc and qc-dev.
    • Configurate protractorConfig and baseUrl.
  5. In package.json file, create new scripts

    • e2e-handbook-backend-qc:
      "e2e-handbook-backend-qc": "ng e2e handbook-backend --dev-server-target=\"\" -c qc"
    • e2e-handbook-backend-qc-dev
      "e2e-handbook-backend-qc": "ng e2e handbook-backend --dev-server-target=\"\" -c qc-dev"
  6. Common methods

    • await page.waitForSelector('#category-simple-list div.simple-list-conatiner div.row-item');
    • await page.clickBySelector('#category-simple-list div.simple-list-conatiner div.row-item div.custom-icon-display button')
    • await page.clearKeyBySelector('#name');
    • await page.sendKeyBySelector('#name', value);
    • page.expectText(value1, value2);
    • page.expectNotEqual(value1, value2);
    • await page.getTextBySelector('div.simple-list-conatiner div.row-item div.col-md-7 span.mat-checkbox-label');
    • await page.getTextBySelector('div.simple-list-conatiner div.row-item:nth-child(1) div.col-md-7 span.mat-checkbox-label');