Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.
/ codeception-utilities Public archive

Generic helper and utility methods for Codeception.

Notifications You must be signed in to change notification settings

ixis/codeception-utilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeception utilities

A handful of generic helper and utility methods for Codeception.

  • seeLinkInSelector/dontSeeLinkInSelector - looks for a link in a particular CSS or XPath selector.
  • seeElementHasStyle/dontSeeElementHasStyle - see an element has been applied a style. Allows you to check a single element has a CSS style assigned, e.g. you can check that ".icon-r" class is floated right. Requires WebDriver.
  • seeRegexInSource/dontSeeRegexInSource - see page source matches a regular expression.

CkEditor utilities

  • fillCkEditor - Fill a CKEditor WYSIWYG field.
  • grabCkEditorValue - Grab the current value of the CKEditor field.
  • seeInCkEditor/dontSeeInCkEditor - see specified text inside a CKEditor instance.

Installing

Add to your composer.json, e.g.

{
  "repositories": [
    {
      "type":"vcs",
      "url":"[email protected]:ixis/codeception-utilities.git"
    }
  ],
  "require": {
    "ixis/codeception-utilities": "dev-develop"
  }
}

Configuring

modules:
    enabled:
        - CodeceptionUtilities
        - CodeceptionCkEditorUtilities

Examples

// See a link with title and URL as specified in the element selected by "#content #footer".
$I->seeLinkInSelector("Facebook", "https://www.facebook.com/", "#content #footer");

// See the element selected by "#footer .icon-r" has the float:right style applied.
$I->seeElementHasStyle("#footer .icon-r", "float", "right");

// Set the ckeditor with id "editor1" to "<p>hello world</p>"
$I->fillCkEditor("editor1", "<p>hello world</p>");

// Grab the current value of the ckeditor field and assert it contains "hello"
$value = $I->grabCkEditorValue("editor1");
PHPUnit_Framework_Assert::assertContains("hello", $value);
// or, if using Asserts Codeception module:
$I->assertContains("hello", $value)

About

Generic helper and utility methods for Codeception.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages