Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
added chatbot
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasLudvik committed Sep 6, 2019
1 parent ba2b720 commit 750f506
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CategoryRepositoryTest was fixed for third domain
- translations were copied from en language and prefixed with (de)
- [#81 - added google tag manager scripts](https://github.com/shopsys/demoshop/pull/81)
- [#80 - added chatbot](https://github.com/shopsys/demoshop/pull/80)
- there is now chatbot displayed on all pages to allow visitors of demoshop to contact Shopsys directly

### Changed
- [#1 - Basic changes in docs, readme etc. after copying from project-base](https://github.com/shopsys/demoshop/pull/1) : [@LukasHeinz]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'admin/components/*.js',
'admin/*.js',
'custom_admin/*.js',
'frontend/plugins/chatbot.js',
]) }}
{{ js_validator_config() }}
{{ init_js_validation() }}
Expand All @@ -76,5 +77,11 @@
{% if app.environment == 'dev' %}
<script async src="//localhost:35729/livereload.js"></script>
{% endif %}

<style type="text/css">
.chatlio-widget {
bottom: 40px;
}
</style>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
window._chatlio = window._chatlio || [];
!function () {
var t = document.getElementById("chatlio-widget-embed");
if (t && window.ChatlioReact && _chatlio.init) return void _chatlio.init(t, ChatlioReact);
for (var e = function (t) {
return function () {
_chatlio.push([t].concat(arguments))
}
}, i = ["configure", "identify", "track", "show", "hide", "isShown", "isOnline", "page", "open", "showOrHide"], a = 0; a < i.length; a++) _chatlio[i[a]] || (_chatlio[i[a]] = e(i[a]));
var n = document.createElement("script"), c = document.getElementsByTagName("script")[0];
n.id = "chatlio-widget-embed", n.src = "https://w.chatlio.com/w.chatlio-widget.js", n.async = !0, n.setAttribute("data-embed-version", "2.3");
n.setAttribute('data-widget-id', '824874cb-7e8b-4a4e-5380-10c1697b3d08');
c.parentNode.insertBefore(n, c);
}();
15 changes: 15 additions & 0 deletions tests/ShopBundle/Acceptance/acceptance/OrderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ public function testFormRemembersPaymentAndTransportWhenClickingBack(
$me->amOnPage('/tv-audio/');
$productListPage->addProductToCartByName('Defender 2.0 SPK-480');
$me->clickByText('Go to cart');

$me->scrollTo(['css' => '#cart_form_submit']);
$me->clickByText('Continue to Order');

$orderPage->assertTransportIsNotSelected('Czech post');
$orderPage->selectTransport('Czech post');
$orderPage->assertPaymentIsNotSelected('Cash on delivery');
$orderPage->selectPayment('Cash on delivery');
$me->waitForAjax();
$me->scrollTo(['css' => '#transport_and_payment_form_save']);
$me->clickByText('Continue in order');
$me->clickByText('Back to shipping and payment selection');

Expand All @@ -57,13 +60,16 @@ public function testFormRemembersPaymentAndTransportWhenGoingDirectlyToUrl(
$me->amOnPage('/tv-audio/');
$productListPage->addProductToCartByName('Defender 2.0 SPK-480');
$me->clickByText('Go to cart');

$me->scrollTo(['css' => '#cart_form_submit']);
$me->clickByText('Continue to Order');

$orderPage->assertTransportIsNotSelected('Czech post');
$orderPage->selectTransport('Czech post');
$orderPage->assertPaymentIsNotSelected('Cash on delivery');
$orderPage->selectPayment('Cash on delivery');
$me->waitForAjax();
$me->scrollTo(['css' => '#transport_and_payment_form_save']);
$me->clickByText('Continue in order');
$me->amOnPage('/order/');

Expand All @@ -83,15 +89,20 @@ public function testFormRemembersFirstName(ProductListPage $productListPage, Ord
$me->amOnPage('/tv-audio/');
$productListPage->addProductToCartByName('Defender 2.0 SPK-480');
$me->clickByText('Go to cart');

$me->scrollTo(['css' => '#cart_form_submit']);
$me->clickByText('Continue to Order');

$orderPage->selectTransport('Czech post');
$orderPage->selectPayment('Cash on delivery');
$me->waitForAjax();
$me->scrollTo(['css' => '#transport_and_payment_form_save'], null, 100);
$me->clickByText('Continue in order');

$orderPage->fillFirstName('Jan');
$me->clickByText('Back to shipping and payment selection');
$me->amOnPage('/order/');
$me->scrollTo(['css' => '#transport_and_payment_form_save'], null, 100);
$me->clickByText('Continue in order');

$orderPage->assertFirstNameIsFilled('Jan');
Expand Down Expand Up @@ -139,17 +150,21 @@ private function testOrderCanBeCompleted(
$me->amOnPage('/tv-audio/');
$productListPage->addProductToCartByName('Defender 2.0 SPK-480');
$me->clickByText('Go to cart');

$me->scrollTo(['css' => '#cart_form_submit']);
$me->clickByText('Continue to Order');

$orderPage->selectTransport('Czech post');
$orderPage->selectPayment('Cash on delivery');
$me->waitForAjax();
$me->scrollTo(['css' => '#transport_and_payment_form_save'], null, 100);
$me->clickByText('Continue in order');

$orderPage->fillPersonalInfo('Karel', 'Novák', '[email protected]', '123456789');
$orderPage->fillBillingAddress('Koksární 10', 'Ostrava', '702 00');
$orderPage->acceptLegalConditions();

$me->scrollTo(['css' => '#order_personal_info_form_save'], null, 100);
$me->clickByText('Finish the order');

$me->see('Order sent');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function applyPromoCode($promoCodeName)
public function removePromoCode()
{
$removePromoCodeButton = $this->webDriver->findElement(WebDriverBy::cssSelector('#js-promo-code-remove-button'));
$this->tester->scrollTo(['css' => '#js-promo-code-remove-button'], null, 100);
$this->tester->clickByElement($removePromoCodeButton);
$this->tester->waitForAjax();
}
Expand Down

0 comments on commit 750f506

Please sign in to comment.