0.5.3 • Published 2 years ago

@peernett/auto-qa v0.5.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Auto-QA

Auto-QA is a powerful automated testing tool that simplifies the process of testing web applications. It provides a set of utilities and functions to execute various testing actions, interact with web pages, and validate results.

Installation

To use Auto-QA in your project, you need to have Node.js installed. Then, you can install Auto-QA using npm:

npm install @peernett/auto-qa


Usage:
Auto-QA can be used programmatically in your JavaScript/TypeScript code. Here's an example of how to use Auto-QA to perform a basic automated test:

import {client,closeBrowser,newClient,} from "./lib/execute.devtool";
import DOMContentLoaded,convertToXPath, waitFor} from "./lib/helpers/action.builder";
import {click,fetchAtt,go,press,type} from "./lib/helpers/functions.beutifier";
import { sessionId } from "./lib/start.session";

export let page: any;

// Chrome settings
export const chromeArgs = [
  "--disable-gpu", // Disable GPU acceleration
  "--disable-infobars", // Disable the "Chrome is being controlled by automated test software" infobar
  // "--headless", // Run Chrome in headless mode (commented out for visibility during automation)
  // "--no-sandbox", // Disable sandboxing for easier setup
  "--window-size=2540,1440",
  "--start-maximized",
  "--remote-debugging-port=9222", // Specify the remote debugging port for CDP
];

// Browser Settings
export const automationArgs = {
  width: 2540, // viewport width
  height: 1440, // viewport height
  deviceScaleFactor: 1,
  mobile: false,
};

export const isMaximized = true; // maximized?

export async function test() {
  page = await newClient();
  await go("https://www.terminalx.com/");
  await click(
    '//*[@id="app-root"]/div[2]/main/div[2]/div/div/div/div/div[3]/div/a[2]',
    1500,
    600
  );
  await waitFor(900);
  await click(
    '//*[@id="app-root"]/div[2]/header/div/div[4]/nav/ul/li[1]/button',
    1500,
    600
  );
  await waitFor(900);
  console.log(convertToXPath([".input_sILM"]));
  await press(
    "Enter",
    await type(
      '//*[@id="app-root"]/div[2]/header/div[2]/div[4]/nav/ul/li[1]/div/form/input',
      "hello",
      5000,
      300
    )
  );
  await waitFor(900);
  await fetchAtt(
    '//*[@id="app-root"]/div[2]/header/div/div[2]/div[1]/div[1]/div/div/div/a/div',
    ["outerHTML", "innerHTML", "textContent"],
    3000,
    300
  );
}


This example incorporates the provided index.ts code into the README file, demonstrating how to import and use the functions and variables from the auto-qa package.

Feel free to modify and expand upon this template according to your project's specific needs.
0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago