0

So, I have this application that I am writing tests for with Cypress. The whole thing is a single-page-application where everything on the application is on the same page.

There are 2 actors to the application, the host and the participant. Whenever the host creates a meeting for the participant to join, an ID is generated from the host side for the participant to join. The meeting has to be active (aka not closed or navigated away from) in order for the participant to join.

Currently, I am trying to join the meeting from the participant side. Can you basically create a new tab and run the test through it with Cypress?

I have tried to run 2 separate test suites, but are then not able to retrieve the ID from test suite 2. I am currently using the following code for retrieving the meeting ID for the host siden:

let meetingId

    cy.get('u[id=meeting-id]').should(($u) => {
        meetingIdInHeader = Cypress.$($u).text();
            console.log(meetingId)

            return meetingId
    })

I am able to get the meetingId from the host side, but unable to do so for the participant side. Any suggestions for how to solve this?

PersianMan
  • 924
  • 1
  • 12
  • 29
flamehme2
  • 1
  • 1
  • Does this help ? https://stackoverflow.com/questions/47749956/access-a-new-window-cypress-io I dont know if what you are trying to do is possible. – ItsNotAndy Nov 08 '21 at 12:48

1 Answers1

0

Currently, I am trying to join the meeting from the participant side. Can you basically create a new tab and run the test through it with Cypress?

No. It's mentioned in the docs here.

I am able to get the meetingID from the host side, but unable to do so for the participant side. Any suggestions for how to solve this?

It seems like you need some persistent storage.

Based on the info you wrote, it seems you might want to consider a different tool that suits your needs in this situation.

pavelsaman
  • 7,399
  • 1
  • 14
  • 32
  • 1
    Thanks! I went for a separate storage, and was able to access the id from the storage. The code for it was basically this: ``` cy.writeFile('id.json', { roomId: meetingId }) ``` In the host part, and in the participant part: ``` cy.readFile('shared.json') ``` and was able to read it from the file! – flamehme2 Nov 08 '21 at 14:52