Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Add test cases for compress PDF #999

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Feature: Compress PDF

Background:
Given I have a new browser context
And I sign in as a type1 user
And I sign in as a type1free user

@regression @unity @compress-pdf @signed-in-type1
@regression @unity @compress-pdf @signed-in-type1free
Scenario: Type1 user upload of single file
Given I go to the compress-pdf page
Then I wait for 5 seconds
Expand All @@ -22,12 +22,12 @@ Feature: Compress PDF
Then I wait for 5 seconds
Then I choose the file "test-files/test.pdf" to upload
Then I wait for 5 seconds
Then I should see the address bar contains "acrobat.adobe.com"
Then I should see the address bar contains "acrobat.adobe.com"

@regression @unity @compress-pdf @multi-files-type1
@regression @unity @compress-pdf @multi-files-type1free
Scenario: Type1 user upload of multiple files
Given I go to the compress-pdf page
When I choose the file "test-files/test.pdf,test-files/test2.pdf" to upload
Then I wait for 5 seconds
Then I should see the address bar contains "acrobat.adobe.com"
Then I should see "To compress this many files at once, you need to select your files again in Acrobat.adobe.com" in the widget error toast
Then I should see the paywall
15 changes: 15 additions & 0 deletions test/e2e/features/unity/regression/compress-pdf-type1-paid.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Compress PDF

Background:
Given I have a new browser context
And I sign in as a type1paid user

@regression @unity @compress-pdf @multi-files-type1paid
Scenario: Type1paid user upload of multiple files
Given I go to the compress-pdf page
When I choose the file "test-files/test.pdf,test-files/test2.pdf" to upload
Then I wait for 5 seconds
Then I should see the address bar contains "acrobat.adobe.com"
Then I click the "Compress" button on the feedback
Then I should see "test-compressed.pdf" in the page content
Then I should see "test2-compressed.pdf" in the page content
2 changes: 1 addition & 1 deletion test/e2e/features/unity/regression/compress-pdf.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Compress PDF
Scenario: Sign in at 3rd attempt
Given I go to the compress-pdf page
And I have tried "compress-pdf" twice
When I sign in as a type1 user using SUSI Light
When I sign in as a type1free user using SUSI Light
Then I should see "Compress PDF" in the dropzone

@regression @unity @compress-pdf @susi-sign-in-type2
Expand Down
1 change: 1 addition & 0 deletions test/e2e/page-objects/unity.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class UnityPage extends classes(DcGnavPage, VerbWidgetSection, CaaSSectio
widgetCompressButton: '*[data-testid="ls-footer-primary-compress-button"]',
widgetToast: '*[class$="-Toast-content"]',
widgetUpsellHeading: 'h1[data-testid$="-upsell-heading"]',
paywall: 'h2[data-testid="paywall-header-subtitle"]',
});
}

Expand Down
9 changes: 7 additions & 2 deletions test/e2e/step-definitions/dc.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ Then(/^I drag-and-drop the (?:PDF|file|files) "([^\"]*)" to upload$/, async func
}
});

Then(/^I sign in as a (type1|type2) user$/, async function (type) {
Then(/^I sign in as a (type1free|type2|type1paid) user$/, async function (type) {
const accounts = JSON.parse(fs.readFileSync(".auth/accounts.json", "utf8"));
const account = accounts[type];
this.page = new DCPage("https://www.stage.adobe.com");
Expand Down Expand Up @@ -728,7 +728,7 @@ Then(/^I have tried "compress-pdf" twice$/, async function () {
await this.page.native.reload({waitUntil: 'load'});
});

Then(/^I sign in as a (type1|type2) user using SUSI Light$/, async function (type) {
Then(/^I sign in as a (type1free|type2|type1paid) user using SUSI Light$/, async function (type) {
const accounts = JSON.parse(fs.readFileSync(".auth/accounts.json", "utf8"));
const account = accounts[type];
await this.page.native.locator('susi-sentry-light #sentry-email-field').click();
Expand Down Expand Up @@ -760,4 +760,9 @@ Then(/^I should see "([^"]*)" in the widget error toast$/, async function (text)
Then(/^I should see "([^"]*)" in the widget upsell heading$/, async function (text) {
this.context(UnityPage);
await expect(this.page.widgetUpsellHeading).toHaveText(text);
});

Then(/^I should see the paywall$/, async function () {
this.context(UnityPage);
await expect(this.page.paywall).toBeVisible({timeout: 30000});
});
Loading