@@ -38,9 +38,9 @@ type OcsEnvelopeResponse = {
3838 files ?: OcsEnvelopeChildFile [ ]
3939}
4040
41- function createIssue7344Scenario ( ) : EnvelopeSigningScenario {
41+ function buildSigningScenario ( ) : EnvelopeSigningScenario {
4242 return {
43- envelopeName : `Issue 7344 envelope ${ Date . now ( ) } ` ,
43+ envelopeName : `Envelope with visible signature ${ Date . now ( ) } ` ,
4444 signerEmail : 'signer01@libresign.coop' ,
4545 signerName : 'Signer 01' ,
4646 }
@@ -209,25 +209,32 @@ async function expectEnvelopeSigned(page: Page, envelopeName: string) {
209209}
210210
211211test ( 'unauthenticated signer can define a visible signature for an envelope with multiple PDFs' , async ( { page } ) => {
212- const scenario = createIssue7344Scenario ( )
212+ const scenario = buildSigningScenario ( )
213213 const mailpit = createMailpitClient ( )
214214
215- // 1. Prepare the signing rules used in this scenario.
216- await enableEnvelopeScenario ( page . request )
215+ await test . step ( 'Given the system is configured to allow envelope signing via e-mail' , async ( ) => {
216+ await enableEnvelopeScenario ( page . request )
217+ } )
217218
218- // 2. Start with a clean inbox and create the envelope already containing
219- // a visible signature box inside the first PDF of the envelope.
220- await mailpit . deleteMessages ( )
221- await createEnvelopeWithVisibleSignatureRequirement ( page . request , scenario )
219+ await test . step ( 'And an envelope with two PDFs is created requiring a visible signature on the first document' , async ( ) => {
220+ await mailpit . deleteMessages ( )
221+ await createEnvelopeWithVisibleSignatureRequirement ( page . request , scenario )
222+ } )
222223
223- // 3. Open the invitation exactly as the external signer would do.
224- const signLink = await waitForSignerInvitationLink ( scenario . signerEmail )
225- await openInvitationAsExternalSigner ( page , signLink )
224+ await test . step ( 'When the external signer opens the invitation link received by e-mail' , async ( ) => {
225+ const signLink = await waitForSignerInvitationLink ( scenario . signerEmail )
226+ await openInvitationAsExternalSigner ( page , signLink )
227+ } )
226228
227- // 4. Define the visible signature and complete the signing action.
228- await defineVisibleSignature ( page )
229- await finishSigning ( page )
229+ await test . step ( 'And the signer draws and saves their visible signature on the document' , async ( ) => {
230+ await defineVisibleSignature ( page )
231+ } )
230232
231- // 5. Confirm the signer reaches the final success screen.
232- await expectEnvelopeSigned ( page , scenario . envelopeName )
233- } )
233+ await test . step ( 'And the signer submits the signed document' , async ( ) => {
234+ await finishSigning ( page )
235+ } )
236+
237+ await test . step ( 'Then the success confirmation screen is shown with the envelope name' , async ( ) => {
238+ await expectEnvelopeSigned ( page , scenario . envelopeName )
239+ } )
240+ } )
0 commit comments