<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Erlan Aytpaev on Medium]]></title>
        <description><![CDATA[Stories by Erlan Aytpaev on Medium]]></description>
        <link>https://medium.com/@aytpaev?source=rss-684333d69f95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Erlan Aytpaev on Medium</title>
            <link>https://medium.com/@aytpaev?source=rss-684333d69f95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:53:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aytpaev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Drupal & Vue.js: how to work without jQuery]]></title>
            <link>https://medium.com/drupal-stories-an-insiders-view/drupal-vue-js-how-to-work-without-jquery-a277fe62b38c?source=rss-684333d69f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/a277fe62b38c</guid>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[drupal]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Erlan Aytpaev]]></dc:creator>
            <pubDate>Tue, 26 Dec 2017 05:14:50 GMT</pubDate>
            <atom:updated>2017-12-26T05:14:50.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/721/0*OmSEHRFyangWzYWA.png" /><figcaption><a href="https://goo.gl/kXQAxN">By ADCI Solutions</a></figcaption></figure><p>Starting with the 5th version, <strong>Drupal</strong> has <strong>jQuery</strong> out of the box. It was an awesome tool for developers. But nowadays we face completely different problems that this library can not solve.</p><p>Why do I suggest you paying attention to Vue.js? I believe it is not another framework. First, it has a huge number of stars and downloads; a lot of front-end developers have a vivid interest in this project so you are not alone and these people can help you. Secondly, <strong>Vue.js</strong> has a large and friendly community. Another reason to get to know Vue.js is <strong>Laravel</strong>. Yes, you are right, this <strong>PHP framework</strong> supports Vue.js out of the box.</p><p>If these reasons don’t persuade you to learn and use Vue.js, please read this article. I will show:</p><ol><li>How you can enhance UI without jQuery;</li><li>How to work with Vue.js components;</li><li>How to integrate Vue.js with third-party libraries;</li><li>How to create a simple <strong>SPA</strong>.</li></ol><h3>Getting Started</h3><p>Let’s get started by describing the possibilities of how we can use this framework in our projects. The easiest way is including &lt;script&gt; tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6d4eca408d4fa17f06d694df107ecda/href">https://medium.com/media/a6d4eca408d4fa17f06d694df107ecda/href</a></iframe><p>Also, you can try out npm package or the <strong>Drupal module</strong>. The Decoupled module still has an issue where users ask to support Vue.js.</p><h3>Enhance UI</h3><p>Unfortunately, Drupal doesn’t allow us to develop a modern reactive user interface. It has jQuery in the core and this library can’t build it. I suggest trying Vue.js to enhance some Drupal user elements.</p><p>For example, we want to show the “Create new account” button only if “Email” and “Username” fields are not empty.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5634bdfceba0e25eccaf218b712d06bc/href">https://medium.com/media/5634bdfceba0e25eccaf218b712d06bc/href</a></iframe><h3>Vue.js components</h3><p>Everyone knows that a typical developer doesn’t reinvent a wheel, but use ready-made solutions. The Vue.js community can offer a lot of awesome components. Let’s try to use one of them.</p><p>I believe that user input data should be validated as on the back-end as on the front-end side. So you have to add</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5959bfbf910de8605d3331be5cd6c565/href">https://medium.com/media/5959bfbf910de8605d3331be5cd6c565/href</a></iframe><blockquote>“vee-validate is a lightweight plugin for Vue.js that allows you to validate input fields, and display errors.” ©</blockquote><p>Also, please change input elements:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e26671056fdda92a68243f6ec636d642/href">https://medium.com/media/e26671056fdda92a68243f6ec636d642/href</a></iframe><p>As you can see, using Vue.js and its components to enhance existing elements is very easy. And I have not faced with any reasons not to do it in your projects right now. However, I think you have a question how to use this framework with other libraries. OK, let’s continue.</p><h3>Vue.js and other libraries</h3><p>In this example, we are integrating a 3rd party jQuery plugin (select2) by wrapping it inside a custom component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80b8759f232c7f029253f3f9e4c6dcde/href">https://medium.com/media/80b8759f232c7f029253f3f9e4c6dcde/href</a></iframe><p>Vue.js doesn’t behave as if it is alone on the site (yes, I’m talking about React ;) ). You will be able to use other js components and allow them to work with Virtual DOM.</p><h3>Single Page Application</h3><p>As usual, the most interesting subject will be discussed at the end. You can find all things to build SPA in vue-router 2. Just include this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32ea3f7e70ac39a3d9639cbc8dcb00c4/href">https://medium.com/media/32ea3f7e70ac39a3d9639cbc8dcb00c4/href</a></iframe><h3>Final words</h3><p>We have gone through all steps together: from the simplest example to SPA. I showed you that Vue.js is very simple and it is useful for any projects. I hope after reading this article you will have a curiosity to practice what you’ve just read. Please have a look at links below. They can also motivate you and help with some problems. Have a nice trip to this beautiful <strong>JS</strong> world!</p><h3>Useful links</h3><ol><li><a href="https://goo.gl/VF97BZ">Vue.js</a></li><li><a href="https://goo.gl/xfJg6A">npm package</a></li><li><a href="https://goo.gl/pD9F3K">The Vue.js module: a bridge between Drupal and Vue.js</a></li><li><a href="https://goo.gl/BxWhVE">The Decoupled Blocks module</a></li><li><a href="https://goo.gl/dXWa3r">“Why we chose Vue.js”</a> by Jacob Schatz</li><li><a href="https://goo.gl/iWiyei">An example of using Vue.js with a contact form</a></li><li>“<a href="https://goo.gl/LQjXqy">A Vue.js introduction for people who know just enough jQuery to get by</a>” by Matt Rothenberg</li></ol><p><em>Originally posted at </em><a href="https://goo.gl/Be8qbk"><em>the ADCI Solutions website</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*5kC2KhUXG-R8C8-59J1RCA.png" /></figure><p>Subscribe to get more articles:</p><p><a href="https://goo.gl/bqSy5w">Subscribe to our Drupal Digest</a></p><p>Read our next article on Medium:</p><p><a href="https://medium.com/drupal-stories-an-insiders-view/how-to-build-a-single-page-application-spa-with-vue-js-5459ea739a3a">How to build SPA with Vue.js</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a277fe62b38c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/drupal-stories-an-insiders-view/drupal-vue-js-how-to-work-without-jquery-a277fe62b38c">Drupal &amp; Vue.js: how to work without jQuery</a> was originally published in <a href="https://medium.com/drupal-stories-an-insiders-view">ADCI Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visual regression testing for Drupal using Gemini]]></title>
            <link>https://medium.com/drupal-stories-an-insiders-view/visual-regression-testing-for-drupal-using-gemini-1d4624fc4a3c?source=rss-684333d69f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d4624fc4a3c</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Erlan Aytpaev]]></dc:creator>
            <pubDate>Thu, 16 Nov 2017 09:20:47 GMT</pubDate>
            <atom:updated>2017-12-11T04:58:18.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*VBQgiUIvfcbsFVu3." /><figcaption><a href="https://goo.gl/7NqvRu">By Erlan Aytpaev</a></figcaption></figure><p><em>Regression testing</em> allows to find bugs caused by the previous changes. This is especially noticeable in the front end. It is common practice — when developers have to test a lot of pages after small changes in <em>CSS</em><strong><em> </em></strong>files.</p><p>I believe that is just a waste of time. We should automate such processes. Although computer vision and AI may be able to solve this problem, nowadays it is difficult to use such technologies. Therefore we will just compare images. For this, you need<strong><em> </em></strong><em>screenshots</em><strong> </strong>of the original and modified pages. There are a lot of tools which allow you to do this not manually. But I prefer to use Gemini.</p><p><em>Gemini</em> is a tool for visual regression testing developed by Yandex. It works with Chrome, Firefox, IE8+ and Opera 12+. Also, it supports some WebDrivers: Selenium Server, Chrome Driver, PhantomJS and cloud WebDrivers, like BrowserStack or SauceLabs.</p><p>To install, run <em>this command:</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68ae0c841b2b17e8fb04a24ec5300224/href">https://medium.com/media/68ae0c841b2b17e8fb04a24ec5300224/href</a></iframe><p>Also, you must have <em>WebDriver</em> and png-img utility.</p><p>Pay special attention to config parameters. I would like to highlight a few of the most important ones:</p><ul><li>rootUrl (required) — a URL of your website which will be tested</li><li>gridUrl — a WebDriver URL for making screenshots</li><li>screenshotsDir — a directory to save screenshots</li><li>tolerance — maximum allowable deviation between two screenshots</li><li>windowSize — browser window’s dimensions</li><li>screenshotMode — image capture mode (fullpage or viewport)</li></ul><p><em>Gemini </em>is configured using .gemini.yml file, but you can override all settings via command-line flags.</p><p><strong>How to work with Gemini</strong></p><p>At the beginning, you have to run you WebDriver. <em>For example</em>, if you use PhantomJS, execute this command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4c9e3513c12f4601cc6f735a512e681/href">https://medium.com/media/b4c9e3513c12f4601cc6f735a512e681/href</a></iframe><p>Because you currently don’t have the reference images with which the following screenshots will be compared, you need to capture them. Just run</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6de25a7d519c480a2ccad8a3919e620/href">https://medium.com/media/e6de25a7d519c480a2ccad8a3919e620/href</a></iframe><p>and <em>Gemini</em> will generate new reference images for your tests. After that you can compare them with the current state of the pages.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0a848c3ca85794a42ad20bf0cc61800/href">https://medium.com/media/a0a848c3ca85794a42ad20bf0cc61800/href</a></iframe><p>If your tests are failed, <em>Gemini</em> will generate new images in the “reports” folder which will display differences.</p><p><strong>How to write Gemini tests</strong></p><p><em>It’s very easy. </em>You need to create a new test file (for example, test.js) and define gemini.suite method in it. Let’s look at a simple example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1fc5d0aa828e14572ecb6270932c6d7/href">https://medium.com/media/c1fc5d0aa828e14572ecb6270932c6d7/href</a></iframe><p>The first argument of this method is a name of your<em> test suite</em>. Then we describe a page that we want to test (the homepage in this example), an element on this page and a new state to capture.</p><p><strong>How to extend Gemini</strong></p><p><em>Gemini</em> supports the plugin system which can extend its functionality. You can find many useful plugins in <a href="https://goo.gl/ot1XwH">this repository</a>. If there is nothing that you need, writing a new one is also very easy.</p><p><em>Gemini plugin</em> is just an npm package. Look at <em>this code</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b756d8f74526e844c12c86bc78045f68/href">https://medium.com/media/b756d8f74526e844c12c86bc78045f68/href</a></iframe><p>You need to define one function which will receive<em> 2 arguments:</em> a Gemini object and necessary options.</p><p><strong>Afterwords</strong></p><p>I hope this article was useful for you and now you understand how easy <em>visual regression testing</em> is. You will no longer need to look through all pages. Now you just can enjoy the development process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*fk6jt-qEmQHwqwfRuFoZtg.png" /></figure><p>Read our <em>next story</em>:</p><p><a href="https://medium.com/drupal-stories-an-insiders-view/oop-in-drupal-8-and-how-to-use-it-to-create-a-custom-module-cf4f5e20a1ab">OOP in Drupal 8 and how to use it to create a custom module</a></p><p>Also, you may find more useful tutorials, articles, and guides in our <a href="https://goo.gl/6vy8EJ">newsletter!</a> Subscribe,<em> it’s free!</em></p><p><em>Originally posted </em><a href="https://goo.gl/EdDgWG"><em>at the ADCI Solutions website.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d4624fc4a3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/drupal-stories-an-insiders-view/visual-regression-testing-for-drupal-using-gemini-1d4624fc4a3c">Visual regression testing for Drupal using Gemini</a> was originally published in <a href="https://medium.com/drupal-stories-an-insiders-view">ADCI Solutions</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>