首页 > 解决方案 > 使用 cy.viewport("anydevice") 运行脚本时,应用程序无法以移动响应模式打开

问题描述

使用 cy.viewport("anydevice") 运行脚本时,应用程序无法以移动响应模式打开。

我正在使用 cypress mocha,但在移动响应视图中看不到应用程序

describe('生产测试套件', function() {

it('TC02_AuthorizedLoginVerification_Mobile', function()
{
  cy.viewport('samsung-s10')
  cy.visit('https://staging.youvisit.com/tour/hanover')
  
  cy.get('div[id=registration-visitortype]').click()
  cy.get('td[item-value=prospective_student').click()
  cy.get('td[item-value=hs_student]').click()
  cy.get('div[id=registration-firstname').click()
  cy.get('input[id=firstname]').type("Test First Name")
  cy.get('div[id=registration-lastname').click()
  cy.get('input[id=lastname]').type("Test Last Name")
  cy.get('div[id=registration-email').click()
  cy.get('input[id=email]').type("Test@gmail.com")
  cy.get('select[id=enrollyear]').select("2021")
  cy.get('select[id=enrollterm]').select("Fall")
  cy.get('input[id=school]').type("Weldon Curt")
  cy.get('select[id=major]').select("Accounting")
  cy.get('select[id=gender]').select("Female")
  cy.get('div[id=registration-birthdate]').type("07/07/2000")
  cy.get('input[id=phone]').type("123456789")
  cy.get('select[id=country]').select("United States (USA)")
  cy.get('input[id=us_street]').type("Test Street") 
  cy.get('input[id=us_postal]').type("02340")
  cy.get('input[id=us_street]').click()
  cy.contains('DONE').click()
  cy.contains('Thanks for your submission!').should('be.visible')
})

})

标签: cypress

解决方案


推荐阅读