title: How to test login to GSuite calendar using Cypress
body: <h2>Environment</h2>
  
  <ul>
  <li>Windows 10</li>
  <li>NodeJs 8</li>
  <li>Cypress 3.1.2</li>
  <li>Selenium</li>
  <li>Chromium v59</li>
  </ul>
  
  <h2>How to authenticate to Google calendar using Cypress?</h2>
  
  <p>I need to run automated tests on a Chrome extension that I am developing.
  The first step is to authenticate/login to GSuite calendar.</p>
  
  <p>I am using Cypress but it is not allowing me to login into GSuite calendar. Instead when "clicking sign-in" (from Cypress) it jumps to the <code>Next</code> button again.</p>
  
  <h2>My code snippet</h2>
  
  <pre><code>describe('Login',function() {
     it('Go to GSuite calendar', function() {
       cy.visit('https://www.google.com/calendar')
     })
  
     it('Login', function() {
       cy.get('#Email').type('my user')
       cy.get('#next').click()
       cy.get('#Passwd').type('my password')
       cy.get('#signIn').click()
     })
  })  
  </code></pre>
  
  <p>This fails and takes me to the <code>Next</code> button</p>
  
  <h2>Screenshots</h2>
  
  <h3>1. Hit execute</h3>
  
  <p><a href="https://i.stack.imgur.com/g5BRM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g5BRM.png" alt="First image "></a></p>
  
  <h3>2. At the end, it returns to the initial screen instead of logging me in</h3>
  
  <p><a href="https://i.stack.imgur.com/93Xvs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/93Xvs.png" alt="Second image"></a></p>
  
  <h1>My Try with Selenium &amp; it works</h1>
  
  <pre><code>from selenium import webdriver
  import time
  
  # variables for userid &amp; password
  u = "JohnDoe@xxxx-labs.com"
  p = "Mysecretpassword"
  
  # chromedriver installation required for login through google chrome
  driverpath = "C:/Users/pjain2/Desktop/chromedriver_win32/chromedriver"
  
  # launch google calendar login page
  d = webdriver.Chrome(driverpath)
  d.get("https://www.google.com/calendar")
  
  # fill email field send_keys for filling text
  e = d.find_element_by_id("identifierId")
  e.send_keys(u)
  
  # find &amp; click next button
  d.find_element_by_xpath("//*[@id='identifierNext']/content/span").click()
  time.sleep(2)
  
  # enter password
  e = d.find_element_by_xpath("//*[@id='password']/div[1]/div/div[1]/input")
  e.send_keys("Mysecretpassword")
  time.sleep(2)
  
  # sign in
  d.find_element_by_xpath("//*[@id='passwordNext']/content/span").click()
  time.sleep(10)
  </code></pre>
  
  <h2>Screenshot of successfully login to Google calendar</h2>
  
  <p><a href="https://i.stack.imgur.com/kWyMh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kWyMh.png" alt="enter image description here"></a>
  I want to achieve the same thing with Cypress</p>
  
  <p>Any pointers?</p>