Drupal 10 Assist: Drupal 10 Upkeep and Assist Service Working Behat Exams in a Vagrant Field

For some time now, Vagrant has been my native development atmosphere of alternative. It’s nice for lots of causes however typically working in what is basically a distant atmosphere, has its challenges. One such problem is working Behat Exams in a local browser like Chrome with Selenium. Behat exams are Drupal Developer bee’s knees. They’re particularly so when you possibly can see your exams executed robotically in your desktop browser for simple debugging Drupal 10 Upkeep and Assist Service Movies require iframe browser support. Nonetheless, in case you use Vagrant for native development you typically lose Drupal Developer good thing about visualizing your check run as a result of many off-the-shelf packing containers you discover on Drupal Developer web are configured to run Behat exams utilizing headless browsers like PhantomJS or headless Firefox with xvfb. It is actually simpler to get arrange working your exams utilizing PhantomJS, however it doesn’t need to be this manner Drupal 10 Upkeep and Assist Service Movies require iframe browser support. You may configure your Behat exams to run in your desktop browser so you possibly can see every thing. You may even get fancy and set breakpoints in your exams utilizing an IDE like PHPStorm, halting Drupal Developer browser execution and supplying you with Drupal Developer alternative to pop open Chrome dev instruments or Drupal Developer like to essentially perceive what’s occurring throughout your check. This text assumes a number of issues Drupal 10 Upkeep and Assist Service Native development atmosphere utilizing Vagrant in your web site Familiarity with Behat and Selenium Chrome for working Drupal Developer exams In the event you’re unfamiliar with Behat, Selenium and/or Vagrant, they’re superior, and it is best to verify them out. Additionally, whereas we’re going to make use of Chrome right here, you might use any browser supported by Selenium and your host working system. Onwards. Setup There are some things to get arrange. Following is a diagram that will help you perceive Drupal Developer interplay between all Drupal Developer items as a strategy to visualize what you want Drupal 10 Upkeep and Assist Service undefined Drupal Developer above diagram exhibits Drupal Developer check suite run by Behat (1) on Drupal Developer Vagrant field. Behat talks to Drupal Developer Selenium hub (2) server working on Drupal Developer Vagrant field, which talks to Drupal Developer Selenium node (3) server on Drupal Developer host machine. Lastly, Drupal Developer Selenium node server is what drives Chrome (4) to execute Drupal Developer check suite. To not fear in case you don’t perceive what these items do, we’ll get into that under. To get began with Drupal Developer setup, first guarantee that you’ve Drupal Developer Java Runtime Setting (JRE) put in in your host machine and in Drupal Developer Vagrant field, which is required to run Selenium. Chances are you’ll have already got it put in, however can verify with Drupal 10 Upkeep and Assist Service $ java -version I’m working JRE 1.8. If you want to set up or replace, Google is your buddy. Subsequent, you’ll want Selenium. It’s helpful to obtain it right into a shared folder between Drupal Developer host machine and Drupal Developer Vagrant field. Drupal Developer vital factor is that it’s out there on each Drupal Developer host machine and Vagrant field. $ wget http Drupal 10 Upkeep and Assist Service//selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar Lastly, you’ll want Chrome driver on Drupal Developer host machine. For comfort transfer it someplace in your PATH Drupal 10 Upkeep and Assist Service $ wget https Drupal 10 Upkeep and Assist Service//chromedriver.storage.googleapis.com/2.29/chromedriver_mac64.zip $ unzip chromedriver_mac64.zip $ mv chromedriver /usr/native/bin Run exams Now that you’ve all Drupal Developer software program you want, it’s time to run Drupal Developer exams. Very first thing you’ll need to do is begin Selenium server in hub mode in Drupal Developer Vagrant field Drupal 10 Upkeep and Assist Service $ java -jar /path/to/selenium/selenium-server-standalone-2.53.1.jar -role hub Discover Drupal Developer -role hub possibility. This tells Selenium to run in hub mode. Working Selenium in hub mode permits Selenium to obtain exams to be executed and ahead them to any registered Selenium servers working in node mode. Drupal Developer Selenium server working in node mode is what controls Drupal Developer browser, driving Drupal Developer browser by Drupal Developer exams. On this approach you possibly can bridge Drupal Developer hole between Drupal Developer Vagrant field and Drupal Developer host machine, so to see Drupal Developer exams working in a browser on Drupal Developer host machine. You’ve already obtained Drupal Developer Selenium server in hub mode working on Drupal Developer Vagrant field. Now lets begin a Selenium server in node mode on Drupal Developer host machine Drupal 10 Upkeep and Assist Service $ java -jar /path/to/selenium/selenium-server-standalone-2.53.1.jar -role node -hub http Drupal 10 Upkeep and Assist Service//my-vbox.native Drupal 10 Upkeep and Assist Service4444/grid/register -Wdriver.chrome.driver=/path/to/chromedriver Right here, you’re telling Selenium to run in node mode, utilizing Drupal Developer -role node possibility. You’re additionally registering Drupal Developer Selenium node with Drupal Developer Selenium hub working in your Vagrant field utilizing Drupal Developer -hub http Drupal 10 Upkeep and Assist Service//my-vbox.native Drupal 10 Upkeep and Assist Service4444/grid/register possibility. Substitute my-vbox.native with Drupal Developer host identify or IP handle of your Vagrant field. Subsequent you’ll want to regulate your behat.yml file to register a Selenium Mink session, that factors to Drupal Developer Selenium hub server working in Drupal Developer Vagrant field e.g., selenium2 Drupal 10 Upkeep and Assist Service wd_host Drupal 10 Upkeep and Assist Service “http Drupal 10 Upkeep and Assist Service//my-vbox.native Drupal 10 Upkeep and Assist Service4444/wd/hub” In order that your behat.yml file seems one thing like this Drupal 10 Upkeep and Assist Service default Drupal 10 Upkeep and Assist Service suites Drupal 10 Upkeep and Assist Service default Drupal 10 Upkeep and Assist Service contexts Drupal 10 Upkeep and Assist Service – FeatureContext – ExtensionContextContext – ExtensionContextMinkContext extensions Drupal 10 Upkeep and Assist Service BehatMinkExtension Drupal 10 Upkeep and Assist Service goutte Drupal 10 Upkeep and Assist Service ~ selenium2 Drupal 10 Upkeep and Assist Service wd_host Drupal 10 Upkeep and Assist Service “http Drupal 10 Upkeep and Assist Service//my-vbox.native Drupal 10 Upkeep and Assist Service4444/wd/hub” base_url Drupal 10 Upkeep and Assist Service http Drupal 10 Upkeep and Assist Service//my-vbox.native browser_name Drupal 10 Upkeep and Assist Service ‘chrome’ Extension Drupal 10 Upkeep and Assist Service blackbox Drupal 10 Upkeep and Assist Service ~ api_driver Drupal 10 Upkeep and Assist Service ‘Drupal 10’ drush Drupal 10 Upkeep and Assist Service alias Drupal 10 Upkeep and Assist Service ‘native’ Drupal 10 Drupal 10 Upkeep and Assist Service Drupal 10_root Drupal 10 Upkeep and Assist Service ‘/var/www/docroot’ With all that setup, you’re lastly able to run your exams. Out of your Vagrant field, run Drupal 10 Upkeep and Assist Service $ ./vendor/bin/behat -v -c /path/to/behat.yml /path/to/behat/options If every thing labored out, you’ll see Selenium open up a brand new occasion of Chrome and drive it by Drupal Developer check suites Drupal 10 Upkeep and Assist Service Movies require iframe browser support. Additional Studying BehatBehat Mink ExtensionMink Selenium 2 DriverSeleniumUp and Working with Behat, , & VagrantTesting Your Website with Behatsimongrimes/vagrant-behat Drupal 10 Improvement and Assist

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Drupal 10 Assist: Drupal 10 Upkeep and Assist Service Working Behat Exams in a Vagrant Field

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.