Skip to content

Commit

Permalink
update readme (#14)
Browse files Browse the repository at this point in the history
* update readme

* update link
  • Loading branch information
resdenia authored Mar 2, 2023
1 parent d66dcb2 commit 8ebaa47
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 19 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ Here you can define the code for your test using [playwright.dev](https://playwr

Click the **Test Script** button to check if the code runs correctly.

3. Define environment variables in the Environment Variables manager.
3. Check if you want to record browser based video of your test.
![UI record-video](assets/record-video.png)

4. You can select device on what you want to start a test.
![UI record-video](assets/select-device.png)

5. Define environment variables in the Environment Variables manager.
![UI env-variable](assets/env-variable.png)

In the Environment Variables manager you can define environment variables that can be attached to your Lambda function. You can use them in the Code editor as `process.env.KEY` and define the `KEY` parameter, which will be present in the Lambda function.

**NOTE:** Prior to testing the code locally, fill in the KEY-VALUE fields for all environment variables used.

4. Download the code as a template or deploy it directly to your cloud provider, using the `Explore/deploy` tab.
6. Download the code as a template or deploy it directly to your cloud provider, using the `Explore/deploy` tab.

## Download as a template

Expand Down Expand Up @@ -73,6 +79,11 @@ and then open [Logz.io](https://app.logz.io/#/dashboard/metrics).

## Changelong

1.2.0:

- Add option to record a browser based video of the test
- Store browser based videos of the test in S3 user bucket

1.1.9:

- Split har reports between pages what will be open during the test
Expand Down
Binary file added assets/record-video.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screen-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screen-edit_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/select-device.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion service/lambdaFunction/rsData.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const readSendData = async (error = '') => {
statusResult: error ? 0 : 1,
sessionId,
nameTest: process.env.NAME_FUNCTION,
videoUrl: `https://${process.env.BUCKET_NAME}.s3.amazonaws/${process.env.NAME_FUNCTION}/${sessionId}.mp4`,
videoUrl: `https://${process.env.BUCKET_NAME}.s3.amazonaws.com/${process.env.NAME_FUNCTION}/${sessionId}.mp4`,
});
await sleep(4000);
logger.sendAndClose();
Expand Down
50 changes: 34 additions & 16 deletions utils/lambdaFunctionLocal/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
const playwright = require('playwright-aws-lambda');
const { chromium } = require('playwright-core');
const path = require('path');

const errorStatusHandler = require('./statusError');

const handlerLocally = async () => {
let context = null;
let err = null;
let page = null;
let browser = null;
try {
browser = await chromium.launch({});
context = await browser.newContext();
page = await context.newPage();
} catch (error) {
const { chromium } = require('playwright-core');
const path = require('path');

const errorStatusHandler = require('./statusError');

const handlerLocally = async () => {
let context = null;
let err = null;
let page = null;
let browser = null;
try {

browser = await chromium.launch({});
context = await browser.newContext();
page = await context.newPage();



await page.goto('https://logz.io/');


await page.waitForSelector('.site-footer__menu_inner_col-2 > .site-footer__menu_group:nth-child(1) > .site-footer__menu_group_list > .site-footer__menu_group_item:nth-child(2) > a')
await page.click('.site-footer__menu_inner_col-2 > .site-footer__menu_group:nth-child(1) > .site-footer__menu_group_list > .site-footer__menu_group_item:nth-child(2) > a')

await page.waitForURL('**/careers/');

await page.waitForSelector('.col-lg-12 > .colomn-footer:nth-child(4) > .footer_list > li:nth-child(2) > a')
await page.click('.col-lg-12 > .colomn-footer:nth-child(4) > .footer_list > li:nth-child(2) > a')

await page.waitForURL('**/blog/');

} catch (error) {
err = error.message;
} finally {
if (browser) {
Expand All @@ -23,6 +40,7 @@ const handlerLocally = async () => {
}
let status = errorStatusHandler(err);
return status;

};
handlerLocally();
handlerLocally()
// module.exports = handlerLocally;

0 comments on commit 8ebaa47

Please sign in to comment.