GithubHelp home page GithubHelp logo

kerasai / miiimooo-behat-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from miiimooo/behat-tools

0.0 0.0 0.0 32 KB

Fork of the miiimooo/behat-tools package to test updating its sabre/dav dependency.

License: GNU General Public License v3.0

PHP 100.00%

miiimooo-behat-tools's Introduction

behat-tools

composer require miiimooo/behat-tools

ParagraphsContext

Support for creating paragraph content in Drupal 8 (only)

Enabling

behat.yml

default:
  suites:
    default:
      contexts:
        - miiimooo\BehatTools\Context\ParagraphsContext

Support for @BeforeParagraphCreate and @AfterParagraphCreate in your own contexts by adding the new extension in behat.yml

  extensions:
    miiimooo\BehatTools\MiiimoooExtension: ~

Usage

In your feature first define the paragraph and name it, then use the name to reference it in a field that references paragraphs:

Feature: Content
  @api
  Scenario: Paragraph creation through Drupal 8 API

    Given a "my_paragraph_type" paragraph named "my_arbitrary_name":
      | title             | Lorem ipsum|

    Given I am viewing a "page" content:
      | title            | Dolor sed         |
      | field_paragraphs | my_arbitrary_name |

DavScreenshotFailureContext

The DavScreenshotFailureContext triggers on a failed stop in a Behat scenario and creates a screenshot in the configured screenshots folder.

Often in CI systems all created containers and artifacts are destroyed at the end of a CI run.

The DavScreenshotFailureContext uploads the screenshots to a WebDAV server.

behat.yml

default:
  suites:
    default:
      contexts:
        - miiimooo\BehatTools\Context\DavScreenshotFailureContext
...
      failure_path: %paths.base%/screenshots

Environment

  • WEBDAV_HOST
  • WEBDAV_FOLDER
  • WEBDAV_USERNAME
  • WEBDAV_PASSWORD
  • DRONE_REPO_NAME
  • DRONE_BUILD_NUMBER
  • CI

CI has to be set to "drone" for the web dav upload to happen

The URI where the screenshot will be saved is constructed as:

WEBDAV_HOST/WEBDAV_FOLDER/DRONE_REPO_NAME-DRONE_BUILD_NUMBER-FEATURE-LINENUMBER-TIMESTAMP.(png/html)

JavascriptOnErrorContext

The JavascriptOnErrorContext triggers on a failed stop in a Behat scenario and prints out any Javascript errors.

behat.yml

default:
  suites:
    default:
      contexts:
        - miiimooo\BehatTools\Context\JavascriptOnErrorContext

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.