A easy way to implement and write Selenium with TypeScript using Deno 🦕
- 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 ✅.
Create a drowser.json in root directory and define some configuration like this:
url
: The url of platform or website that need to be test
{
"url": "http://url_of_the_platform_need_to_be_tested"
}
Install npm dependecies on node_modules
with this command:
deno install --allow-scripts
In test file , Define a sample test like this:
With this test we only test this sample code inside a Chrome ,Firefox but create a test for another web browser like Edge, Safari 🚀
import { driver } from "https://deno.land/x/drowser@v0.1.6/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));
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
Import this reports inside of the studio to visualize all the metrics for main cases or each test case
This project is licensed under the MIT License - see the LICENSE file for details.