Skip to content

Commit

Permalink
adjust e2e test for private key and ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom-jaksov-tl committed Nov 22, 2024
1 parent 5f6a089 commit db43f91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
REPLACE INTO `admin_user` VALUES (1,'Example','Example','user@example.com','exampleuser','12b66e0132008acb13a9eb880f9ff4e7393b64b74722dcda435a03ec7e0dd780:TWLwiabBH2lIPcDkKLrhu37GsEBRpnSb:3_32_2_67108864','2024-09-23 01:02:08','2024-10-10 16:39:29','2024-10-10 16:39:29',1,0,1,NULL,NULL,NULL,'en_US',0,NULL,NULL);
REPLACE INTO `admin_analytics_usage_version_log` VALUES (1,'2.4.6');
REPLACE INTO `core_config_data` VALUES (4,'default',0,'currency/options/base','GBP','2024-10-11 11:26:34'),(5,'default',0,'currency/options/default','GBP','2024-10-11 11:26:34'),(6,'default',0,'currency/options/allow','GBP','2024-10-11 11:26:34');
REPLACE INTO `core_config_data` VALUES (18,'default',0,'admin/usage/enabled','0','2024-10-10 16:43:40'),(19,'default',0,'carriers/flatrate/active','0','2024-10-10 16:43:40'),(20,'default',0,'carriers/flatrate/handling_fee',NULL,'2024-10-10 16:43:40'),(21,'default',0,'carriers/flatrate/specificcountry',NULL,'2024-10-10 16:43:40'),(22,'default',0,'carriers/flatrate/showmethod','0','2024-10-10 16:43:40'),(23,'default',0,'carriers/flatrate/sort_order',NULL,'2024-10-10 16:43:40'),(24,'default',0,'carriers/freeshipping/active','1','2024-10-10 16:43:40'),(25,'default',0,'carriers/freeshipping/free_shipping_subtotal',NULL,'2024-10-10 16:43:40'),(26,'default',0,'carriers/freeshipping/specificcountry',NULL,'2024-10-10 16:43:40'),(27,'default',0,'carriers/freeshipping/showmethod','0','2024-10-10 16:43:40'),(28,'default',0,'carriers/freeshipping/sort_order',NULL,'2024-10-10 16:43:40'),(29,'default',0,'carriers/tablerate/handling_fee',NULL,'2024-10-10 16:43:40'),(30,'default',0,'carriers/tablerate/specificcountry',NULL,'2024-10-10 16:43:40'),(31,'default',0,'carriers/tablerate/showmethod','0','2024-10-10 16:43:40'),(32,'default',0,'carriers/tablerate/sort_order',NULL,'2024-10-10 16:43:40'),(33,'default',0,'carriers/ups/shipper_number',NULL,'2024-10-10 16:43:40'),(34,'default',0,'carriers/ups/handling_fee',NULL,'2024-10-10 16:43:40'),(35,'default',0,'carriers/ups/free_shipping_enable','0','2024-10-10 16:43:40'),(36,'default',0,'carriers/ups/specificcountry',NULL,'2024-10-10 16:43:40'),(37,'default',0,'carriers/ups/showmethod','0','2024-10-10 16:43:40'),(38,'default',0,'carriers/ups/debug','0','2024-10-10 16:43:40'),(39,'default',0,'carriers/ups/sort_order',NULL,'2024-10-10 16:43:40'),(40,'default',0,'carriers/usps/userid',NULL,'2024-10-10 16:43:40'),(41,'default',0,'carriers/usps/password',NULL,'2024-10-10 16:43:40'),(42,'default',0,'carriers/usps/handling_fee',NULL,'2024-10-10 16:43:40'),(43,'default',0,'carriers/usps/free_shipping_enable','0','2024-10-10 16:43:40'),(44,'default',0,'carriers/usps/specificcountry',NULL,'2024-10-10 16:43:40'),(45,'default',0,'carriers/usps/debug','0','2024-10-10 16:43:40'),(46,'default',0,'carriers/usps/showmethod','0','2024-10-10 16:43:40'),(47,'default',0,'carriers/usps/sort_order',NULL,'2024-10-10 16:43:40'),(48,'default',0,'carriers/fedex/account',NULL,'2024-10-10 16:43:40'),(49,'default',0,'carriers/fedex/meter_number',NULL,'2024-10-10 16:43:40'),(50,'default',0,'carriers/fedex/key',NULL,'2024-10-10 16:43:40'),(51,'default',0,'carriers/fedex/password',NULL,'2024-10-10 16:43:40'),(52,'default',0,'carriers/fedex/handling_fee',NULL,'2024-10-10 16:43:40'),(53,'default',0,'carriers/fedex/residence_delivery','0','2024-10-10 16:43:40'),(54,'default',0,'carriers/fedex/smartpost_hubid',NULL,'2024-10-10 16:43:40'),(55,'default',0,'carriers/fedex/free_shipping_enable','0','2024-10-10 16:43:40'),(56,'default',0,'carriers/fedex/specificcountry',NULL,'2024-10-10 16:43:40'),(57,'default',0,'carriers/fedex/debug','0','2024-10-10 16:43:40'),(58,'default',0,'carriers/fedex/showmethod','0','2024-10-10 16:43:40'),(59,'default',0,'carriers/fedex/sort_order',NULL,'2024-10-10 16:43:40'),(60,'default',0,'carriers/dhl/id',NULL,'2024-10-10 16:43:40'),(61,'default',0,'carriers/dhl/password',NULL,'2024-10-10 16:43:40'),(62,'default',0,'carriers/dhl/handling_fee',NULL,'2024-10-10 16:43:40'),(63,'default',0,'carriers/dhl/free_method_nondoc',NULL,'2024-10-10 16:43:40'),(64,'default',0,'carriers/dhl/free_shipping_enable','0','2024-10-10 16:43:40'),(65,'default',0,'carriers/dhl/specificcountry',NULL,'2024-10-10 16:43:40'),(66,'default',0,'carriers/dhl/showmethod','0','2024-10-10 16:43:40'),(67,'default',0,'carriers/dhl/debug','0','2024-10-10 16:43:40'),(68,'default',0,'carriers/dhl/sandbox_mode','0','2024-10-10 16:43:40'),(69,'default',0,'carriers/dhl/sort_order',NULL,'2024-10-10 16:43:40'),(70,'default',0,'payment/truelayer/active','1','2024-10-10 16:44:45'),(71,'default',0,'payment/truelayer/merchant_account_name',NULL,'2024-10-10 16:44:45'),(72,'default',0,'payment/truelayer/mode','sandbox','2024-10-10 16:44:45'),(73,'default',0,'payment/truelayer/sandbox_client_id','${{ secrets.TEST_CLIENT_ID }}','2024-10-10 16:44:45'),(74,'default',0,'payment/truelayer/sandbox_client_secret','','2024-10-10 16:44:45'),(75,'default',0,'payment/truelayer/sandbox_key_id','${{ secrets.TEST_KID }}','2024-10-10 16:44:45'),(76,'default',0,'payment/truelayer/sandbox_private_key','sandbox/default/private-key.pem','2024-10-10 16:44:45'),(77,'default',0,'payment/truelayer/specificcountry','GB,IE,ES,FR,DE,NL,LT','2024-10-10 16:44:45'),(78,'default',0,'payment/truelayer/send_order_email','0','2024-10-10 16:44:45'),(79,'default',0,'payment/truelayer/send_invoice_email','0','2024-10-10 16:44:45'),(80,'default',0,'payment/truelayer/banking_providers','retail','2024-10-10 16:44:45'),(81,'default',0,'payment/truelayer/payment_page_primary_color','#000000','2024-10-10 16:44:45'),(82,'default',0,'payment/truelayer/payment_page_secondary_color','#e53935','2024-10-10 16:44:45'),(83,'default',0,'payment/truelayer/payment_page_tertiary_color','#32329f','2024-10-10 16:44:45'),(84,'default',0,'payment/truelayer/logging','0','2024-10-10 16:44:45');
REPLACE INTO `core_config_data` VALUES (18,'default',0,'admin/usage/enabled','0','2024-10-10 16:43:40'),(19,'default',0,'carriers/flatrate/active','0','2024-10-10 16:43:40'),(20,'default',0,'carriers/flatrate/handling_fee',NULL,'2024-10-10 16:43:40'),(21,'default',0,'carriers/flatrate/specificcountry',NULL,'2024-10-10 16:43:40'),(22,'default',0,'carriers/flatrate/showmethod','0','2024-10-10 16:43:40'),(23,'default',0,'carriers/flatrate/sort_order',NULL,'2024-10-10 16:43:40'),(24,'default',0,'carriers/freeshipping/active','1','2024-10-10 16:43:40'),(25,'default',0,'carriers/freeshipping/free_shipping_subtotal',NULL,'2024-10-10 16:43:40'),(26,'default',0,'carriers/freeshipping/specificcountry',NULL,'2024-10-10 16:43:40'),(27,'default',0,'carriers/freeshipping/showmethod','0','2024-10-10 16:43:40'),(28,'default',0,'carriers/freeshipping/sort_order',NULL,'2024-10-10 16:43:40'),(29,'default',0,'carriers/tablerate/handling_fee',NULL,'2024-10-10 16:43:40'),(30,'default',0,'carriers/tablerate/specificcountry',NULL,'2024-10-10 16:43:40'),(31,'default',0,'carriers/tablerate/showmethod','0','2024-10-10 16:43:40'),(32,'default',0,'carriers/tablerate/sort_order',NULL,'2024-10-10 16:43:40'),(33,'default',0,'carriers/ups/shipper_number',NULL,'2024-10-10 16:43:40'),(34,'default',0,'carriers/ups/handling_fee',NULL,'2024-10-10 16:43:40'),(35,'default',0,'carriers/ups/free_shipping_enable','0','2024-10-10 16:43:40'),(36,'default',0,'carriers/ups/specificcountry',NULL,'2024-10-10 16:43:40'),(37,'default',0,'carriers/ups/showmethod','0','2024-10-10 16:43:40'),(38,'default',0,'carriers/ups/debug','0','2024-10-10 16:43:40'),(39,'default',0,'carriers/ups/sort_order',NULL,'2024-10-10 16:43:40'),(40,'default',0,'carriers/usps/userid',NULL,'2024-10-10 16:43:40'),(41,'default',0,'carriers/usps/password',NULL,'2024-10-10 16:43:40'),(42,'default',0,'carriers/usps/handling_fee',NULL,'2024-10-10 16:43:40'),(43,'default',0,'carriers/usps/free_shipping_enable','0','2024-10-10 16:43:40'),(44,'default',0,'carriers/usps/specificcountry',NULL,'2024-10-10 16:43:40'),(45,'default',0,'carriers/usps/debug','0','2024-10-10 16:43:40'),(46,'default',0,'carriers/usps/showmethod','0','2024-10-10 16:43:40'),(47,'default',0,'carriers/usps/sort_order',NULL,'2024-10-10 16:43:40'),(48,'default',0,'carriers/fedex/account',NULL,'2024-10-10 16:43:40'),(49,'default',0,'carriers/fedex/meter_number',NULL,'2024-10-10 16:43:40'),(50,'default',0,'carriers/fedex/key',NULL,'2024-10-10 16:43:40'),(51,'default',0,'carriers/fedex/password',NULL,'2024-10-10 16:43:40'),(52,'default',0,'carriers/fedex/handling_fee',NULL,'2024-10-10 16:43:40'),(53,'default',0,'carriers/fedex/residence_delivery','0','2024-10-10 16:43:40'),(54,'default',0,'carriers/fedex/smartpost_hubid',NULL,'2024-10-10 16:43:40'),(55,'default',0,'carriers/fedex/free_shipping_enable','0','2024-10-10 16:43:40'),(56,'default',0,'carriers/fedex/specificcountry',NULL,'2024-10-10 16:43:40'),(57,'default',0,'carriers/fedex/debug','0','2024-10-10 16:43:40'),(58,'default',0,'carriers/fedex/showmethod','0','2024-10-10 16:43:40'),(59,'default',0,'carriers/fedex/sort_order',NULL,'2024-10-10 16:43:40'),(60,'default',0,'carriers/dhl/id',NULL,'2024-10-10 16:43:40'),(61,'default',0,'carriers/dhl/password',NULL,'2024-10-10 16:43:40'),(62,'default',0,'carriers/dhl/handling_fee',NULL,'2024-10-10 16:43:40'),(63,'default',0,'carriers/dhl/free_method_nondoc',NULL,'2024-10-10 16:43:40'),(64,'default',0,'carriers/dhl/free_shipping_enable','0','2024-10-10 16:43:40'),(65,'default',0,'carriers/dhl/specificcountry',NULL,'2024-10-10 16:43:40'),(66,'default',0,'carriers/dhl/showmethod','0','2024-10-10 16:43:40'),(67,'default',0,'carriers/dhl/debug','0','2024-10-10 16:43:40'),(68,'default',0,'carriers/dhl/sandbox_mode','0','2024-10-10 16:43:40'),(69,'default',0,'carriers/dhl/sort_order',NULL,'2024-10-10 16:43:40'),(70,'default',0,'payment/truelayer/active','1','2024-10-10 16:44:45'),(71,'default',0,'payment/truelayer/merchant_account_name',NULL,'2024-10-10 16:44:45'),(72,'default',0,'payment/truelayer/mode','sandbox','2024-10-10 16:44:45'),(73,'default',0,'payment/truelayer/sandbox_client_id','${{ secrets.TEST_CLIENT_ID }}','2024-10-10 16:44:45'),(74,'default',0,'payment/truelayer/sandbox_client_secret','','2024-10-10 16:44:45'),(75,'default',0,'payment/truelayer/sandbox_key_id','${{ secrets.TEST_KID }}','2024-10-10 16:44:45'),(76,'default',0,'payment/truelayer/sandbox_private_key','','2024-10-10 16:44:45'),(77,'default',0,'payment/truelayer/specificcountry','GB,IE,ES,FR,DE,NL,LT','2024-10-10 16:44:45'),(78,'default',0,'payment/truelayer/send_order_email','0','2024-10-10 16:44:45'),(79,'default',0,'payment/truelayer/send_invoice_email','0','2024-10-10 16:44:45'),(80,'default',0,'payment/truelayer/banking_providers','retail','2024-10-10 16:44:45'),(81,'default',0,'payment/truelayer/payment_page_primary_color','#000000','2024-10-10 16:44:45'),(82,'default',0,'payment/truelayer/payment_page_secondary_color','#e53935','2024-10-10 16:44:45'),(83,'default',0,'payment/truelayer/payment_page_tertiary_color','#32329f','2024-10-10 16:44:45'),(84,'default',0,'payment/truelayer/logging','0','2024-10-10 16:44:45');
REPLACE INTO `catalog_product_entity` VALUES (1,4,'simple','test-product',0,0,'2024-10-10 16:41:56','2024-10-10 16:41:56');
REPLACE INTO `catalog_product_entity_decimal` VALUES (1,77,0,1,0.010000),(2,82,0,1,1.000000);
REPLACE INTO `catalog_product_entity_int` VALUES (1,97,0,1,1),(2,136,0,1,2),(3,99,0,1,4);
Expand All @@ -69,7 +69,9 @@ jobs:
EOF
- name: Set encrypted client secret
run: docker exec magento sh -c 'php bin/magento config:set payment/truelayer/sandbox_client_secret $(php -r "require \"vendor/autoload.php\"; require \"app/bootstrap.php\"; \$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, \$_SERVER); \$bootstrap->createApplication(\Magento\Framework\App\Http::class); \$encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Encryption\EncryptorInterface::class); echo \$encryptor->encrypt(\"${{ secrets.TEST_CLIENT_SECRET }}\");")'
run: |
docker exec magento sh -c 'php bin/magento config:set payment/truelayer/sandbox_client_secret $(php -r "require \"vendor/autoload.php\"; require \"app/bootstrap.php\"; \$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, \$_SERVER); \$bootstrap->createApplication(\Magento\Framework\App\Http::class); \$encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Encryption\EncryptorInterface::class); echo \$encryptor->encrypt(\"${{ secrets.TEST_CLIENT_SECRET }}\");")'
docker exec magento sh -c 'php bin/magento config:set payment/truelayer/sandbox_private_key $(php -r "require \"vendor/autoload.php\"; require \"app/bootstrap.php\"; \$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, \$_SERVER); \$bootstrap->createApplication(\Magento\Framework\App\Http::class); \$encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Framework\Encryption\EncryptorInterface::class); echo \$encryptor->encrypt(\"${{ secrets.TEST_PEM }}\");")'
- name: Reindex products
run: docker exec magento php bin/magento indexer:reindex
Expand All @@ -84,4 +86,4 @@ jobs:
docker exec -w /data/extensions/magento2 magento npx playwright install
- name: Run tests
run: docker exec --env PW_TEST_HTML_REPORT_OPEN=never -w /data/extensions/magento2 magento npx playwright test --project=chromium --reporter=line
run: docker exec --env PW_TEST_HTML_REPORT_OPEN=never -w /data/extensions/magento2 magento npx playwright test --project=chromium --reporter=line
16 changes: 8 additions & 8 deletions tests/e2e/pages/hosted-payments-page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from '@playwright/test';
import { expect, Page } from '@playwright/test';

export class HostedPaymentsPage {
page: Page;
Expand All @@ -8,14 +8,14 @@ export class HostedPaymentsPage {
}

// Locators
mockBank = () => this.page.getByLabel('Select Mock UK Payments - Redirect Flow', { exact: true });
continueButton = () => this.page.getByTestId('confirm-redirect-button');
continueOnDesktopButton = () => this.page.getByTestId('continue-desktop');
mockBank = () => this.page.getByLabel('Mock UK Payments - Redirect Flow', { exact: true });
continueButton = () => this.page.getByText('Go to bank');
continueOnDesktopButton = () => this.page.getByText('on this device');

// Methods
async selectMockBankAndContinueOnDesktop() {
await this.selectMockBankAndContinue();
await this.continueOnDesktopButton().isVisible()
await expect(this.continueOnDesktopButton()).toBeVisible({timeout: 5000})
await this.continueOnDesktopButton().click();
}

Expand All @@ -24,9 +24,9 @@ export class HostedPaymentsPage {
}

private async selectMockBankAndContinue(){
await this.mockBank().isVisible();
await expect(this.mockBank()).toBeVisible({timeout: 5000})
await this.mockBank().click();
await this.continueButton().isVisible();
await expect(this.continueButton()).toBeVisible({timeout: 5000})
await this.continueButton().click();
}
}
}

0 comments on commit db43f91

Please sign in to comment.