Trafficlight adapter for hydrogen-web
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-11-02 13:48:51 +05:30
src Don't access private property 2022-11-02 13:48:31 +05:30
.editorconfig Iniital Commit 2022-10-31 13:48:05 +05:30
.eslintrc Write more actions 2022-11-02 13:05:28 +05:30
.gitignore WIP 2022-10-31 13:48:09 +05:30
.ts-eslintrc.js Write more actions 2022-11-02 13:05:28 +05:30
LICENSE Iniital Commit 2022-10-31 13:48:05 +05:30
package.json Write more actions 2022-11-02 13:05:28 +05:30
README.md Add a readme 2022-11-02 13:48:51 +05:30
trafficlight.config.json WIP 2022-10-31 13:48:09 +05:30
tsconfig.json Write more actions 2022-11-02 13:05:28 +05:30
yarn-error.log Iniital Commit 2022-10-31 13:48:05 +05:30
yarn.lock Write more actions 2022-11-02 13:05:28 +05:30

Hydrogen Web Adapter

Trafficlight adapter for hydrogen web!

Running


yarn install
yarn test:trafficlight

Adding new actions


This adapter will pickup any actions defined in .ts files from src/actions.

To define a new set of actions (eg: relating to settings):

  1. Create a new file in src/actions (say settings.ts, any name is fine).
  2. Export an object as follows:
    import { Page }  from "playwright";
    import { Browser } from "playwright";
    import { BrowserContext } from "playwright";
    
    type Args = {
        page: Page;
        data: any;
        browser: Browser;
        context: BrowserContext;
    };
    
    module.exports = {
        "my-action-1": async ({context, browser, data, page}: Args) => {
            // Logic for your actions
            // await page.selector("#matrix-foo).click();
        },
        "my-action-2": async ({context, browser, data, page}: Args) => {
            // Logic for your actions
            // await page.selector("#matrix-foo).click();
        },
    };
    
  3. Run the adapter, and look at the output to see if your actions were picked up:
    The following actions were found:
    login, logout, enable_dehydrated_device, idle, wait, exit, reload, clear_idb_storage, create_room, open_room, accept_invite, send_message, verify_message_in_timeline, verify_last_message_is_utd