-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stage' into MWPW-137111-region-selector-modal
- Loading branch information
Showing
21 changed files
with
292 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { createTag } from './miloUtils.js'; | ||
|
||
const cardImageMappings = [ | ||
{ name: 'AMEX_V_MC_D_DU_JCB_PP', filename: 'amex_v_mc_d_du_jcb_pp.jpg' }, | ||
{ name: 'AMEX_V_MC_JCB_JPBANK', filename: 'amex_v_mc_jcb_jpbank.png' }, | ||
{ name: 'AMEX_V_MC_PP', filename: 'amex_v_mc_pp.jpg' }, | ||
{ name: 'AMEX_VISA_MC_D_DU_ELC_PP_BOLETO', filename: 'amex_visa_mc_d_du_elc_pp_boleto.jpg' }, | ||
{ name: 'AMEX_VISA_MC_D_DU_JCB_PAYPAL', filename: 'amex_visa_mc_d_du_jcb_paypal.jpg' }, | ||
{ name: 'AMEX_VISA_MC_D_PAYPAL', filename: 'amex_visa_mc_d_paypal.jpg' }, | ||
{ name: 'AMEX_VISA_MC_JCB_JPBANK_JPSTORE', filename: 'amex_visa_mc_jcb_jpbank_jpstore.png' }, | ||
{ name: 'V_MC_DD_PP', filename: 'v_mc_dd_pp.jpg' }, | ||
{ name: 'V_MC', filename: 'v_mc.jpg' }, | ||
]; | ||
|
||
export default async function replacePlaceholdersWithImages(documentElement) { | ||
const paragraphs = documentElement.querySelectorAll('p'); | ||
await createTag.then((tag) => { | ||
paragraphs.forEach((p) => { | ||
cardImageMappings.forEach((mapping) => { | ||
const cardName = p.innerHTML.trim(); | ||
const matchedImage = cardName === mapping.name; | ||
if (matchedImage) { | ||
const imagePath = `/acrobat/img/icons/credit-cards-${mapping.filename}`; | ||
const imgAttributes = { | ||
src: imagePath, | ||
loading: 'lazy', | ||
'data-local': 'credit-cards', | ||
}; | ||
const imgElement = tag('img', imgAttributes); | ||
imgElement.onerror = async () => { | ||
window.lana?.log(`Error loading image for credit-card placeholder: ${cardName}`); | ||
imgElement.remove(); | ||
}; | ||
p.replaceWith(imgElement); | ||
} | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Feature: CaaS Block | ||
|
||
Background: | ||
Given I have a new browser context | ||
|
||
@MWPW-132351 @regression-caas | ||
Scenario Outline: CaaS block on frictionless | ||
Given I go to the <Verb> page | ||
Then I should see the CaaS block | ||
Then I should see the 'More resources' header | ||
Then I should see the CaaS block cards | ||
Then I click the "Read now" button inside the CaaS card | ||
Then I switch to the new page after clicking "Read now" button in the CaaS | ||
Then I should not see the address bar contains "<Verb>" | ||
Examples: | ||
| Verb | | ||
| add-pages-to-pdf | | ||
| compress-pdf | | ||
| convert-pdf | | ||
| delete-pdf-pages | | ||
| excel-to-pdf | | ||
| extract-pdf-pages | | ||
| merge-pdf | | ||
| password-protect-pdf | | ||
| pdf-editor | | ||
| pdf-to-excel | | ||
| pdf-to-jpg | | ||
| request-signature | | ||
| rotate-pdf | | ||
| sign-pdf | | ||
| split-pdf | | ||
| word-to-pdf | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { classes } from "polytype"; | ||
import { DcGnavPage } from "./dcgnav.page"; | ||
import { PdfWidgetSection } from "./pdfwidget.section"; | ||
|
||
export class CaaSPage extends classes(DcGnavPage, PdfWidgetSection) { | ||
constructor(contentPath) { | ||
let locContentPath = contentPath; | ||
// if locale is specified, add to the path | ||
if (global.config.profile.locale) { | ||
locContentPath = locContentPath.replace(/^\/*|\/*$/g, ''); | ||
if (global.config.profile.locale === 'us') { | ||
locContentPath = `/${locContentPath}`; | ||
} else { | ||
locContentPath = `/${global.config.profile.locale}/${locContentPath}`; | ||
} | ||
} | ||
super({ | ||
super: DcGnavPage, | ||
arguments: [locContentPath], | ||
}); | ||
this.buildProps({ | ||
caas: '#caas', | ||
caasFragment: '.fragment[data-path*="caas"]>>nth=0', | ||
caasButton: 'a[data-testid="consonant-BtnInfobit"]' | ||
}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/e2e/frictionless/page-objects/passwordprotectpdf.page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { FrictionlessPage } from './frictionless.page'; | ||
|
||
export class PasswordProtectPdfPage extends FrictionlessPage { | ||
constructor() { | ||
super("/acrobat/online/password-protect-pdf"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.