You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature: Login
Scenario: Heroku Login
Given I open the heroku login page
When I should see the Login Page title
When I type in
| username | password |
| tomsmith | SuperSecretPassword! |
And I click login button
Then "Secure Area" should be shown
Step definition
const login_url = '/login'
import {Given, When, And, Then} from "cypress-cucumber-preprocessor/steps"
Given('I open the heroku login page', () => {
before(() => {
cy.visit(login_url)
cy.url()
.should('eq', Cypress.config().baseUrl + login_url)
})
When('I should see the Login Page title', () => {
cy.get('h2')
.should('contain', 'Login Page')
})
When('I type in', (datatable) => {
datatable.hashes().forEach(element=>{
cy.get('#username').type(element.username)
cy.get('#password').type(element.password)
})
})
And('I click login button', () => {
cy.get('.fa').contains('Login').click()
cy.get('.icon-2x').contains('Logout').click()
})
Then('{string} should be shown', (content) => {
cy.contains(content, {timeout:10000}).should('be.visible')
})
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm getting the following error when trying to run a cypress test within the cucumber
> Error: Parsing file /Users/endowus/Projects/Collab/mywork/Cypress/herokuappLogin/cypress/integration/FeatureFiles/Login.feature: Unexpected token (29:50)
Feature file
Step definition
plugin > index.js
Anyone have faced this kind of issue and sorted it out or can anyone help me>?
Beta Was this translation helpful? Give feedback.
All reactions