This is a working Google SSO Cypress Test. describe('Login', () => { it('Login through Google', () => { const username = Cypress.env('googleSocialLoginUsername') alert(username) const password = Cypress.env('googleSocialLoginPassword') const loginUrl = Cypress.env('loginUrl') const cookieName = Cypress.env('cookieName') const socialLoginOptions = { username: username, password: password, loginUrl: loginUrl, headless: true, logs: false, loginSelector: '[href="http://127.0.0.1:8000/auth/google"]', postLoginSelector: '.bg-scholarpath-500' } return cy.task('GoogleSocialLogin', socialLoginOptions).then(({cookies}) => { cy.clearCookies() const cookie = cookies.filter(cookie => cookie.name === cookieName).pop() if (cookie) { cy.setCookie(cookie.name, cookie.value, { domain: cookie.domain, expiry: cookie.expires, httpOnly: cookie.httpOnly, path: cookie.path, secure: cookie.secure })

Make sure this url matches the url for your google auth route. Also, postLoginSelector is a class on your "Log in with Google" button.

Add the following to your plugins/index.js file: const {GoogleSocialLogin} = require('cypress-social-logins').plugins module.exports = (on, config) => { on('task', { GoogleSocialLogin: GoogleSocialLogin })}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners