mardi 14 janvier 2020

Approve document as multiple users

I am pretty new to cypress. We are using cucumber plugin for Bdd and respective js files for the code.

I have beloW a scenario where in I have to do the below steps to approve a single document say DOC01.

Background- generate new document with unique name everytime this runs - login as user01 - upload a document and submit this for approval - user01 now codes the document which in turn assigns 2 groups to it (user02 ) and (user03)

** scenario:** - login as user 02 - click on approve button to approve the above generated document from the backgroUnd

Scenario: - login as user 02 - click on approve button to approve the above generated document from the background

Problem: At the end of each Scenario, I seem to have a partially completed document which is partially approved only and not completely approved because background for this feature will generate 2 documents.

Suggestion needed: what would be the best way to approach this test such that I use single document and approve as two users?

From what I understand, best practices suggests to have tests independent of each other. Hence my structure is above. The only solution I could think was to make the document generation step as my scenario but the last two scenarios will be dependent on that. This is against the best practices though?

Alternatively, there is Scenario outline I can possibly use, but I need example for that if you have.

Aucun commentaire:

Enregistrer un commentaire