Skip to content

Instantly share code, notes, and snippets.

View Vinay08sharma's full-sized avatar

Vinay Sharma Vinay08sharma

View GitHub Profile
# #this is working docker file
version: "3.8"
services:
web:
image: selenium/standalone-chrome
volumes:
- /dev/shm:/dev/shm
- ./tempDownload:/home/seluser/Downloads
ports:
echo "------Setting the Permission--------"
sudo chmod -R 777 /home/seluser/Downloads
exit
it('Verify on click of download PDF, PDF should be downloaded', async () => {
driver.navigate('url')
reporter.startStep('Clicking on download PDF button');
await topicPage.clickDownloadPDF();
await studentDriver.pause(20000); // Download take some time, you can add code to wait until file exist
const isPresent = DirectoryUtils.validateFileIsPresentInDirectory(filePath);
chaiExpect(isPresent,
'Expected the presence of file, but not found').to.be.true;
});
@Vinay08sharma
Vinay08sharma / emailUtil.js
Created February 19, 2022 20:04
Email Util through which email can be sent via code in JS using nodemailer
const nodemailer = require("nodemailer");
function sendMail() {
let transporter = nodemailer.createTransport({
service:"gmail",
host: "smtp.gmail.com",
auth: {
user: "<senderUserName>", // add username
pass: "<senderPassword>", // password
}
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: webdriverio-ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: webdriverio-ci
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests against'
type: choice
required: true
{
"URLs" : [
"https://www.google.com",
"https://www.npmjs.com",
"https://www.npmjs.com/login"
]
}
export const thresholds = {
performance: 80,
accessibility: 50,
'best-practices': 50,
seo: 50
}
const { playAudit } = require('playwright-lighthouse');
const { test, chromium } = require('@playwright/test');
const lighthouseDesktopConfig = require('lighthouse/lighthouse-core/config/lr-desktop-config');
const { thresholds } = require('../data/thresholdData');
const { URLs } = require("../resources/urls.json");
const options = {
loglevel: "info",
}
version: '3'
services:
selenoid:
image: "aerokube/selenoid:latest"
container_name: selenoid
ports:
- "4445:4444"
networks:
- selenoid
volumes: