Drupal News

Valuebound: Selenium: A beginner’s guide to automation testing tool to ensure better user experience

  • Before delving into the how of automation testing using Selenium, let me talk about the why.

    Over the past couple of years, the demand for automation has increased at an unprecedented speed and scale as it indispensably minimizes the testing time, eliminate repetitive human tasks and make life easier. The advent of an open source automation testing tools, such as Selenium, has significantly reduced the demand and scope of manual testing.

    Needless to say, every testing has its own quirks and best practices! However, there are certain standard best practices that generally apply to most automation, too. Let’s review the best practices of automation testing. You…

    3 days 14 hours ago

Appnovation Technologies: SEO for Drupal Series, Part 1: Project Discovery and The Google Algorithm

  • SEO for Drupal Series, Part 1: Project Discovery and The Google Algorithm SEO for Drupal Part One - Project Discovery and The Google Algorithm In this new, fortnightly ‘A-Z of Drupal SEO and SEM’ series of Appnovation blog posts, we’ll see what it takes to turn a Drupal site into a traffic magnet, driving traffic growth and providing better Call to Action fulfillments without us...

    3 days 15 hours ago

I just got a Drupal project and never worked with it in my life.

Lullabot: React in Drupal Core?

PreviousNext: Testing CSV output in Drupal 8 with BrowserTestBase

  • Share:

    In a recent project we were outputting CSV and wanted to test that the file contents were valid.

    Read on for a quick tip on how to achieve this with Drupal 8's BrowserTestBase

    by Lee Rowlands / 20 October 2017

    Basically, the easiest way to validate and parse CSV in PHP is with the built in fgetcsv function.

    So how do you go about using that inside a functional test - in that instance we're not dealing with a file so its not your ordinary approach for fgetcsv.

    The answer is to create a stream wrapper in memory, and use fgetcsv on that.

    The code looks something like this:

    $response = $this->getSession() ->getDriver() ->getContent(); // Put contents into a memory stream and use fgetcsv to parse. $stream = fopen('php://memory', 'r+'); fwrite($stream, $response); rewind($stream); $records = []; // Get the header row. $header = fgetcsv($stream); while ($row = fgetcsv($stream)) { $records[] = $row; } fclose($stream);

    There you have it, you now have the header in $header and the rows in $rows and can do any manner of asserts that you need to validate the CSV generation works as expected.

    Tagged Drupal 8, Testing, Functional Testing

    Posted by Lee Rowlands
    Senior Drupal Developer

    Dated 20 October 2017

    Add new comment

    4 days 1 hour ago

Drupal 8 - Grouping Repeatable Fields Programatically

  • I'm in the middle of coding a custom entity in Drupal 8. Currently, I'm defining fields using the baseFieldDefinitions method. I've run into a small problem now where I have a subset of fields that need to be grouped together and repeatable. For example, I have a checkbox, a text box, and a select box that all need to be associated while allowing someone to click an "Add" button to produce another set of those three fields.

    It seems that if I was using the UI to create a custom content type, then I could use Paragraphs to handle this, but I wasn't able to figure out how to do that in code, and all the modules that are used in Drupal 7 as example of how to do this either don't exist in D8, or point to using Paragraphs instead.

    Some ideas that I had:

    1. Create all three as repeatable fields in baseFieldDefinitions and override the form to present them as a unit and write some ajax to make it work the way I want. I don't think this is ideal because it seems like I'm fighting the framework.

    2. Make this group of fields into their own entity and try to figure out how to add an entity creation form inside my parent entity creation form. I'm not sure if this is possible, but it seems like it should be.

    3. Use hook_schema to create a database table with the three fields that I need and an additional column to tie that record to my custom entity. This is the way I would have done it in Drupal 7, but I'm worried about the long term of running reports in Views using the data that isn't in the Entity itself. This seems like the quick and dirty way to do it but I don't want a Views headache later.

    4. Figure out how to do this in Paragraphs.

    Hopefully, someone with a little more experience than I have in D8 can point me to the most preferable way to handle this. Any help would be greatly appreciated.

    submitted by /u/kb_klash
    [link] [comments]

    4 days 2 hours ago

Drupal Association blog: Drupal Association Board Meeting Summary - 28 September, 2017

  • On 28 September 2017, the Drupal Association held its third open board meeting of the year where community members listened in via zoom and in person. You can find the meeting minutes, board materials, and meeting recording here.

    The board meeting was kicked off by an update from Dries Buytaert, followed by an Executive update from Megan Sanicki, Executive Director, and a Drupal.org update from Tim Lehnen, Director of Engineering. We also thanked and celebrated Tiffany Farriss, Vesa Palmu, and Jeff Walpole whose terms on the board end in November.

    Dries Buytaert moving from Chairman to Founding Director position

    One of the key announcements made during the meeting came from Dries Buytaert, who announced that in response to the Community Discussions findings, he is stepping down from the Drupal Association Chairman position. He will remain on the board in the Founding Director position.  This will go into effect in November when board seats expire and Adam Goodman will step into the role as interim Chairman, which is also in response to the community’s request for a neutral, outside expert to lead the board. To learn more about the Community Discussions, go here.

    Adam Goodman is a leadership professor from Northwest University in Chicago, Illinois, USA. He's advised the Drupal Association on and off for the past 8 years, helping us evolve from a volunteer board to a strategic board. In this role, Adam will further evolve the board so it can orient itself around a new chairman structure.

    Since Adam is a paid consultant, the Drupal Association needs to change its bylaws to allow Adam to sit on the board and be paid for his service. In addition to this change, we are doing a general update of the bylaws to include:

    • Eliminate non-existent committees like the HR committee

    • Modernize the tools we can use for online voting. Today we can use teleconferencing, but we also need to be able to use video conferencing.

    To learn more about this board meeting, please watch the recording and stay tuned for an update on other improvements we are making in response to the community’s input.

    4 days 4 hours ago

Drupal Association blog: Status of Speaker Agreement Violation

  • Our community does amazing things together and they deserve to have the best working environment for collaboration. At the Drupal Association, we strive to create these open and collaborative environments at DrupalCon and on Drupal.org.

    We recently became aware that a community member violated our speaker agreement at DrupalCon. The Drupal Association removed the video from the DrupalCon event site and the Drupal Association YouTube channel and we are determining additional actions. The community member acknowledged that they broke the speaker agreement and is cooperating with the Drupal Association as we take action.

    We apologize that this content was shared. It didn’t create the best environment for our community to thrive and we will do better. We are looking at ways to enhance our process to avoid situations like this from happening again.

    We also heard from the community discussion findings that were provided this summer, that the community needs a better understanding of the roles and responsibilities for volunteers that work on Drupal Association programs. The Drupal Association is working to define what is expected of each role and policies for managing situations when expectations are not met. We are working on developing a clear outline of these and you can expect to see them finalized by February 2018.

    4 days 5 hours ago

Navigation tree for anchor points?

  • Hi all,

    I'm hoping for some advice on the best way to implement a navigation tree that can be customized for anchor points within individual nodes. I have ~300 pages with a fair amount of educational content that will need a customized sidebar like this. Any ideas for the most straightforward way to get this done?

    It would need to look something like this:

    HEADER
    -Subhead
    -Subhead
    HEADER
    -Subhead
    -Subhead
    --L2Subhead
    -Subhead
    -Subhead
    --L2Subhead
    HEADER
    -Subhead

    HEADER

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Subhead

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Subhead

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    HEADER

    Subhead

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Subhead

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    L2Subhead

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    etc.

    Thanks in advance!

    submitted by /u/DrupalDrawers
    [link] [comments]

    4 days 5 hours ago

Pages