测试E2E赛普拉斯Laravel Jetstream失败单击

时间:2020-09-21 10:27:17

标签: laravel automated-tests cypress laravel-8 jetstream

我在cypress上编写了以下测试,该测试注册了,但给我带来了点击管理帐户的问题:

import faker from 'faker'
describe('Registration', () => {
const email = faker.internet.email()
const password = faker.internet.password()
it('successfully registering', () => {
    cy.visit('http://l8.test/register')
    cy.get('input[name=name]').type(faker.name.findName())
    cy.get('input[name=email]').type(email)
    cy.get('input[name=password]').type(password)
    cy.get('input[name=password_confirmation]').type(password)
    cy.get('button').contains('Register').click()
    cy.url().should('contain', '/dashboard')
    //I would like to click on the Management Account, but I can't
    cy.get('button.flex.text-sm.border-2.border-transparent.rounded-full.focus:outline-none.focus:border-gray-300.transition.duration-150.ease-in-out').click()
    //   cy.contains('Logout').click()
})
})

给我以下错误:

button.flex.text-sm.border-2.border-transparent.rounded-full.focus:轮廓无焦点:border-gray-300.transition.duration-150.ease-in-out 错误 语法错误,无法识别的表达式:不支持的伪:outline-none

基本上,我希望他单击以下内容: enter image description here

1 个答案:

答案 0 :(得分:1)

  cy.get('button.flex.text-sm.border-2.border-transparent.rounded-full').click()