This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { GoogleSocialLogin } = require('./googleLogin'); | |
| module.exports = (on, config) => { | |
| on('task', { | |
| 'GoogleSocialLogin': GoogleSocialLogin, | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| beforeEach( function() { | |
| window.logCalls = 1; | |
| }); | |
| Cypress.Commands.overwrite('log', (originalFn, message) => { | |
| Cypress.log({ | |
| displayName: `--- ${window.logCalls}. ${message} ---`, | |
| name: `--- ${window.logCalls}. ${message} ---`, | |
| message: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const app = new Vue({ | |
| // ... | |
| }).$mount('#trello-app'); | |
| window.app = app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('viewport test', () => { | |
| cy.visit('/') | |
| cy.viewport(320, 480) | |
| cy.viewport('iphone-5') | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('changing user agent', () => { | |
| cy.visit('/', { | |
| onBeforeLoad: (win) => { | |
| Object.defineProperty(win.navigator, 'userAgent', { | |
| value: 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', | |
| }); | |
| } | |
| }) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('touch device', () => { | |
| cy.visit('/', { | |
| onBeforeLoad: (win) => { | |
| win.ontouchstart = true | |
| } | |
| }) | |
| }) |
OlderNewer