andostronaut / drowser

A easy way to implement and write Selenium with TypeScript using Deno πŸ¦•

Home Page:https://deno.land/x/drowser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drowser

build deno module deno compatibility license

A easy way to implement and write Selenium with TypeScript using Deno πŸ¦•

Features

  • Easy handling on driver side web browser to isolate each test βœ….
  • Get a daily log file to check all test process if passed or failed βœ….
  • Export each test case inside the reports βœ….

Configuration

You need to create a drowser.json in root directory and define some configuration like this:

  • url: The url of platform or website you want to test
{
  "url": "http://url_of_the_platform_need_to_be_tested"
}

Usage

In your test file , you can define a sample test like this:

With this test we only test this sample code inside a Chrome ,Firefox but you can create a test for another web browser like Edge, Safari πŸš€

import { driver } from "https://deno.land/x/drowser@v0.1.5/mod.ts";

driver({ browser: "chrome" })
  .then(({ service }) => {
    service.cases = [
      {
        name: "Verify Failed Title",
        fn: async ({ builder, assert }) => {
          const title = await builder.getTitle();
          assert.assertEquals(title, "Drowsers");
        },
      },
      {
        name: "Verify Title",
        fn: async ({ builder, assert }) => {
          const title = await builder.getTitle();
          assert.assertEquals(title, "Drowser");
        },
      },
    ];
  })
  .catch((error) => console.log(error));

driver({ browser: "firefox" })
  .then(({ service }) => {
    service.cases = [
      {
        name: "Verify Failed Title",
        fn: async ({ builder, assert }) => {
          const title = await builder.getTitle();
          assert.assertEquals(title, "Drowsers");
        },
      },
      {
        name: "Verify Title",
        fn: async ({ builder, assert }) => {
          const title = await builder.getTitle();
          assert.assertEquals(title, "Drowser");
        },
      },
    ];
  })
  .catch((error) => console.log(error));

Drowser Studio

Each test case is saved inside the drowser-reports.json file , and this file is exploitable inside the Drowser Studio who is developed by the Kinotio Team in this repo , who is open-source

You can import this reports inside of the studio to visualize all the metrics for main cases or each test case

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.

About

A easy way to implement and write Selenium with TypeScript using Deno πŸ¦•

https://deno.land/x/drowser

License:MIT License


Languages

Language:TypeScript 100.0%