Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Sep 16, 2024
1 parent 222a20c commit 3b4802f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"pr": {
"ci": {
"include": [
{
"php": "8.1",
"sylius": "1.12.x",
"symfony": "5.4.x",
"mysql": "8.0",
"state_machine": "winzou_state_machine"
},
{
"php": "8.3",
"sylius": "1.13.x",
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
PANTHER_NO_SANDBOX: 1
PANTHER_CHROME_ARGUMENTS: '--disable-dev-shm-usage --window-size=1400,900'
TPAY_API_URL: 'http://localhost:4000'
TPAY_CLIENT_ID: '{{ secrets.TPAY_CLIENT_ID }}'
TPAY_CLIENT_SECRET: '{{ secrets.TPAY_CLIENT_SECRET }}'
TPAY_CARDS_API: '{{ secrets.TPAY_CARDS_API }}'
PAYUM_CYPHER_KEY: '{{ secrets.PAYUM_CYPHER_KEY }}'
TPAY_CLIENT_ID: ${{ secrets.TPAY_CLIENT_ID }}
TPAY_CLIENT_SECRET: ${{ secrets.TPAY_CLIENT_SECRET }}
TPAY_CARDS_API: ${{ secrets.TPAY_CARDS_API }}
PAYUM_CYPHER_KEY: ${{ secrets.PAYUM_CYPHER_KEY }}

steps:
-
Expand Down
7 changes: 7 additions & 0 deletions tests/E2E/Checkout/TpayPaymentCheckoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public function test_it_completes_the_checkout(): void
public function test_it_completes_the_checkout_using_credit_card(): void
{
$this->processWithPaymentMethod('tpay_card');
$this->client->wait(1);
$this->client->takeScreenshot(dirname(__DIR__, 3) . '/tests/Application/var/log/one.png');
file_put_contents(dirname(__DIR__, 3) . '/tests/Application/var/log/one.html', $this->client->getPageSource());
$this->fillCardData('John Doe', self::CARD_NUMBER, '123', '01', '2029');

$this->client->wait(1);
$this->client->takeScreenshot(dirname(__DIR__, 3) . '/tests/Application/var/log/two.png');
file_put_contents(dirname(__DIR__, 3) . '/tests/Application/var/log/two.html', $this->client->getPageSource());
$this->placeOrder();

$this->assertPageTitleContains('Thank you!');
Expand Down
21 changes: 17 additions & 4 deletions tests/E2E/Helper/Order/TpayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ trait TpayTrait
{
public function fillCardData(string $holderName, string $cardNumber, string $cvv, string $month, string $year): void
{
$this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_holder_name'))->sendKeys($holderName);
$this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_number'))->sendKeys($cardNumber);
$this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_cvv'))->sendKeys($cvv);
$this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_expiration_date_year'))->sendKeys($year);
$this->client->executeScript(
sprintf('document.querySelector(\'#sylius_checkout_complete_tpay_card_holder_name\').value = "%s"', $holderName),
);

$this->client->executeScript(
sprintf('document.querySelector(\'#sylius_checkout_complete_tpay_card_number\').value = "%s"', $cardNumber),
);
$this->client->executeScript(
sprintf('document.querySelector(\'#sylius_checkout_complete_tpay_card_cvv\').value = "%s"', $cvv),
);
$this->client->executeScript(
sprintf('document.querySelector(\'#sylius_checkout_complete_tpay_card_expiration_date_year\').value = "%s"', $year),
);
// $this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_holder_name'))->sendKeys($holderName);
// $this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_number'))->sendKeys($cardNumber);
// $this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_cvv'))->sendKeys($cvv);
// $this->client->findElement(WebDriverBy::id('sylius_checkout_complete_tpay_card_expiration_date_year'))->sendKeys($year);
}

public function fillBlikToken(string $blikToken): void
Expand Down

0 comments on commit 3b4802f

Please sign in to comment.