Skip to content

Commit

Permalink
Merge pull request #89 from iamando/develop
Browse files Browse the repository at this point in the history
feat: update version to v0.1.3 and update readme
  • Loading branch information
Ando authored May 30, 2024
2 parents 94fc7e8 + 925f421 commit 80d7c4d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
54 changes: 36 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,49 @@

A easy way to implement and write Selenium with TypeScript using Deno 🦕

> Still working on managing custom function test using selenium webdriver builder ℹ️
>
> But for now we have already implemented test using object type like you can see in the usage section 🚀
## 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 ✅.
- Possibility to export test case as Log ✅.
- 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
- `exportPdf`: Set to `true` if you want to export your test reports inside a pdf file

```json
{
"url": "http://url_of_the_platform_need_to_be_tested",
"exportPdf": false
"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 🚀

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

driver({ browser: "chrome" })
.then(({ service }) => {
service.cases = [
async ({ builder, assert }) => {
service.case_name = "Verify Title";
const title = await builder.getTitle();
assert.assertEquals(title, "Drowser");
{
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");
},
},
];
})
Expand All @@ -58,17 +63,30 @@ driver({ browser: "chrome" })
driver({ browser: "firefox" })
.then(({ service }) => {
service.cases = [
async ({ builder, assert }) => {
service.case_name = "Verify Title";
const title = await builder.getTitle();
assert.assertEquals(title, "Drowser");
{
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));
```

With this test we only test this sample code inside a Chrome Webdriver but you can create a test for another web browser like Firefox, Edge, Safari 🚀
## 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](https://github.com/kinotio/drowser) , 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

Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iamando/drowser",
"version": "0.1.2",
"version": "0.1.3",
"exports": "./mod.ts",
"importMap": "./import_map.json",
"tasks": {
Expand Down

0 comments on commit 80d7c4d

Please sign in to comment.