-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Connect the default shipping method to PayPal payment method
This should prevent that the cart amount is changed on the confirm page, which is not expected to happen in the E2E scenarios
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Tests/E2E/helper/connectDefaultShippingMethodWithPayPalHelper.mjs
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,21 @@ | ||
import MysqlFactory from './mysqlFactory.mjs'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
const connectDefaultShippingMethodWithPayPalSql = fs.readFileSync(path.join(path.resolve(''), 'setup/sql/connect_default_shipping_method_with_paypal.sql'), 'utf8'); | ||
const connection = MysqlFactory.getInstance(); | ||
|
||
export default (function() { | ||
return { | ||
connectDefaultShippingMethodWithPayPal: async function() { | ||
await new Promise((resolve, reject) => { | ||
connection.query(connectDefaultShippingMethodWithPayPalSql, function(err) { | ||
if (err) { | ||
reject(err); | ||
} | ||
resolve(); | ||
}); | ||
}); | ||
} | ||
}; | ||
}()); |
5 changes: 5 additions & 0 deletions
5
Tests/E2E/setup/sql/connect_default_shipping_method_with_paypal.sql
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,5 @@ | ||
SET @shippingMethodId = (SELECT id FROM `s_premium_dispatch` WHERE name='Standard Versand'); | ||
SET @paymentMethodId = (SELECT id FROM `s_core_paymentmeans` WHERE name='SwagPaymentPayPalUnified'); | ||
|
||
INSERT INTO `s_premium_dispatch_paymentmeans`(`dispatchID`, `paymentID`) VALUES (@shippingMethodId, @paymentMethodId) | ||
ON DUPLICATE KEY UPDATE `dispatchID` = `dispatchID`, `paymentID` = `paymentID`; |
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