Drupal

Drupal Testing: DOM Selectors

 

Create Article  - Links Multiple Values

//table/*//input[starts-with(@id,"edit-field-links")]'

 

$x('//table/*//input[starts-with(@id,"edit-field-links")]')
(4) [input#edit-field-links-0-uri--kqe8gMbTwQ0.form-autocomplete.form-text.ui-autocomplete-input, input#edit-field-links-0-title--LRVpDrS0r8M.form-text, input#edit-field-links-1-uri--Np7fGnJEb9A.form-autocomplete.form-text.ui-autocomplete-input, input#edit-field-links-1-title--axXfvkpAN3o.form-text]

 

$x('//table/*//input[starts-with(@id,"edit-field-links-0-title")]')
[input#edit-field-links-0-title--LRVpDrS0r8M.form-text]
$x('//table/*//input[starts-with(@id,"edit-field-links-0-uri")]')
[input#edit-field-links-0-uri--kqe8gMbTwQ0.form-autocomplete.form-text.ui-autocomplete-input]

 

 

 

Parse this down to selectors, but has good strategies for iframe and 'mouse-hover' actions

Tags

Drupal Testing: CucumberJVM Workflow

Create Gherkin Feature File

  • Add BDD feature & scenario data

 

 

Create Test Runner File

  • glue = StepDefs
  • DryRun=true
  •  

 

Create StepDefs File under /StepDefs

  • Add Step Definitions to code files under StepDefs
  • Best to organize StepDefs into subfolders for 'feature', 'sprints', 'macros', navigation, testID
  • Duplicate method names CAN NOT exist in this StepDefs package
    • So... BDD language should be carefully planned out for maximizing re-use & avoiding redundancy of actions
    • if 5 stepdefs are created for login and the login routine changes....
      • will have to update the same routine 5 times.
  • Macros are helpful for multi-step routines that are commonly used across tests

 

 

Drupal Testing: BDD Considerations

 

Feature Files

  • The Gherkin feature files should be treated like software & managed with great care
  • In doing so, not only will the framework be more concise & maintainable, but the BDD feature files essentially will write the framework themselves.
  • Shared Step Definition files can act as reusable macros, making scenarios shorter while reducing the size of the framework and time to maintain them.
  • Come up with a standard language and syntax for ALL feature files
  • Create templates in Excel that have available test steps to choose from
    • this will significantly reduce the amount of coding required for each scenario through REUSE
    • and thereby reduce the time it takes to automate them
    • and thereby avoid duplication of code & the cost of maintaining it

 

Tags

Engine Yard: 15 Expert Tips for Using Cucumber

Engine Yard: 15 Expert Tips for Using Cucumber

  • This article has some very good thoughts on managing BDD test frameworks
  • The Gherkin feature files should be treated like software & managed with great care
  • In doing so, not only will the framework be more concise & maintainable, but the BDD feature files essentially will write the framework themselves.
  • Shared Step Definition files can act as reusable macros, making scenarios shorter while reducing the size of the framework and time to maintain them.

https://www.engineyard.com/blog/15-expert-tips-for-using-cucumber

Tags

Drupal 8: Zircon Theme Styling

Theme Styling

  • CSS Folder location: drupal8/themes/zircon/css

html.css

/* */
/*  */
/* line 12, ../sass/includes/_include.scss */
.box_shadow {
  box-shadow: 0 0 5px #ccc;
  -webkit-box-shadow: 0 0 5px #ccc;
}

/* line 16, ../sass/includes/_include.scss */
.border_radius {
  border-radius: 5px;
  -webkit-border-radius: 5px;
}

/* line 21, ../sass/includes/_include.scss */
.font_oswald, h1, .h1, h2, .h2, h3, .h3 {
  font-family: 'oswaldregular';
}

/* BUTTON */
/* line 27, ../sass/includes/_include.scss */
.form-actions .form-submit {
  margin: 0 10px 10px 0;
  border: none;
  padding: 8px 20px;
  color: #fff;
  background: #c01700;
  border-radius: 3px;
  -webkit-border-radius: 3px;
  cursor: pointer;
}
/* line 36, ../sass/includes/_include.scss */
.form-actions .form-submit:hover, .form-actions .form-submit:focus {
  background-color: #555555;
}

/* line 41, ../sass/includes/_include.scss */
.font_awesome {
  display: inline-block;
  fo
Tags

Drupal 8: Zircon Theme Fix for 'Skip To Main Content'


The Zircon theme has an odd link in the upper left corner when visiting as an 'Unauthenticated User'.

Skip to main content

 

Update The following theme file:

<root_dir>\themes\zircon\templates\html.html.twig

 

Comment or remove the link anchor tag

<a href="#main-content" class="visually-hidden focusable"> {{ 'Skip to main content'|t }} </a>

<!--a href="#main-content" class="visually-hidden focusable"> {{ 'Skip to main content'|t }} </a-->

 

Tags
Subscribe to Drupal