Skip to content

Instantly share code, notes, and snippets.

View filiphric's full-sized avatar
⏯️
Working at Replay.io

Filip Hric filiphric

⏯️
Working at Replay.io
View GitHub Profile
describe('Logging to Google SSO protected event', () => {
it('Receive token and successfully open app', () => {
const socialLoginOptions = {
username: // google name here
password: // google password here
loginUrl: // your login page (in your app), where you would click on a „login with google“ button, this is url which puppeteer will open
resolveUrl: // the page where you land after you come back from google
headless: // set to tru
const { GoogleSocialLogin } = require('./googleLogin');
module.exports = (on, config) => {
on('task', {
'GoogleSocialLogin': GoogleSocialLogin,
});
};
const puppeteer = require('puppeteer');
module.exports.GoogleSocialLogin = async function GoogleSocialLogin(options = {}) {
try {
validateOptions(options);
const browser = await puppeteer.launch({ headless: !!options.headless, args: ['--no-sandbox', '--disable-setuid-sandbox'] });
const page = await browser.newPage();
@filiphric
filiphric / mailosaur.js
Last active August 11, 2022 10:48
Cypress request to mailosaur API
const userEmail = 'email.abcdefg@mailosaur.io'
describe('Reset password flow', () => {
it('Should receive an email and use reset password link', () => {
// trigger reset password for user
// this command is equal to clicking „I forgot my password“ link and entering user email
cy
.userPasswordReset(userEmail)