From 51c2a403c4ad0376bbc96623cc80e51fb5d8ccb6 Mon Sep 17 00:00:00 2001 From: insleker Date: Tue, 2 Sep 2025 10:35:44 +0800 Subject: [PATCH] docs: add multi signature picture in user stories and use cases --- docs/FRs.md | 4 ++ docs/use_cases.md | 6 +-- ...upport_multiple_signature_pictures.feature | 38 +++++++++++++++++++ .../support_multiple_signatures.feature | 12 +++--- 4 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 test/features/support_multiple_signature_pictures.feature diff --git a/docs/FRs.md b/docs/FRs.md index 343bae1..5792e98 100644 --- a/docs/FRs.md +++ b/docs/FRs.md @@ -42,3 +42,7 @@ * role: user * functionality: the ability to sign multiple locations within a PDF document * benefit: documents requiring multiple signatures can be signed simultaneously +* name: [support multiple signature pictures](../test/features/support_multiple_signature_pictures.feature) + * role: user + * functionality: the ability to use different signature pictures for different signing locations + * benefit: close to real-world signing scenarios where every signature is not the same diff --git a/docs/use_cases.md b/docs/use_cases.md index 44a9b9e..c4abd55 100644 --- a/docs/use_cases.md +++ b/docs/use_cases.md @@ -1,6 +1,4 @@ # Use cases -Use cases are derived from `FRs.md` (user stories) and `meta-arch.md`. Each Feature name matches the corresponding user story; scenarios focus on observable behavior without restating story details. - -The Gherkin scenarios live in runnable BDD feature files under `test/features/`. - +Use cases are derived from `FRs.md` (user stories) and `meta-arch.md`. Each Feature name matches the corresponding user story; +The use cases are written in runnable `Gherkin` BDD feature files at `test/features/*.feature`. diff --git a/test/features/support_multiple_signature_pictures.feature b/test/features/support_multiple_signature_pictures.feature new file mode 100644 index 0000000..c5cab5c --- /dev/null +++ b/test/features/support_multiple_signature_pictures.feature @@ -0,0 +1,38 @@ +Feature: support multiple signature pictures + + Scenario: Place signatures on different pages with different images + Given a multi-page PDF is open + When the user places a signature from picture on page + And the user places a signature from picture on page + Then both signatures are shown on their respective pages + Examples: + # Same page, same image + # Same page, different images + # Different pages, same image + # Different pages, different images + | first_image | first_page | second_image | second_page | + | 'alice.png' | 1 | 'alice.png' | 1 | + | 'alice.png' | 1 | 'bob.png' | 1 | + | 'alice.png' | 1 | 'bob.png' | 3 | + | 'bob.png' | 2 | 'alice.png' | 5 | + + Scenario: Reuse the same image for more than one signature + Given a signature image is loaded or drawn + When the user places it in multiple locations in the document + Then identical signature instances appear in each location + And adjusting one instance does not affect the others + + Scenario: Reassign a different image to an existing signature + Given a PDF page is selected for signing + And an image {"alice.png"} is loaded + And the user places a signature on the page + When an image {"bob.png"} is loaded + And the user assigns {"bob.png"} to the selected signature + Then the selected signature is shown with image {"bob.png"} + + Scenario: Save/export uses the assigned image for each signature + Given a PDF is open and contains multiple placed signatures across pages + When the user saves/exports the document + Then all placed signatures appear on their corresponding pages in the output + And other page content remains unaltered + diff --git a/test/features/support_multiple_signatures.feature b/test/features/support_multiple_signatures.feature index 7198fa4..18fec8d 100644 --- a/test/features/support_multiple_signatures.feature +++ b/test/features/support_multiple_signatures.feature @@ -2,8 +2,8 @@ Feature: support multiple signatures Scenario: Place signatures on different pages Given a multi-page PDF is open - When the user places a signature on page 1 - And the user navigates to page 3 and places another signature + When the user places a signature on page {1} + And the user navigates to page {3} and places another signature Then both signatures are shown on their respective pages Scenario: Place multiple signatures on the same page independently @@ -25,10 +25,10 @@ Feature: support multiple signatures And the other signatures remain unchanged Scenario: Keep earlier signatures while navigating between pages - Given a signature is placed on page 2 - When the user navigates to page 5 and places another signature - Then the signature on page 2 remains - And the signature on page 5 is shown on page 5 + Given a signature is placed on page {2} + When the user navigates to page {5} and places another signature + Then the signature on page {2} remains + And the signature on page {5} is shown on page {5} Scenario: Save a document with multiple signatures across pages Given a PDF is open and contains multiple placed signatures across pages