GithubHelp home page GithubHelp logo

isabella232 / mink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lyft/mink

0.0 0.0 0.0 493 KB

PHP 5.3 acceptance test framework for web applications

Home Page: http://mink.behat.org/

License: MIT License

PHP 99.92% JavaScript 0.08%

mink's Introduction

Mink

Usage Example

<?php

use Behat\Mink\Mink,
    Behat\Mink\Session,
    Behat\Mink\Driver\GoutteDriver,
    Behat\Mink\Driver\SahiDriver;

$startUrl = 'http://example.com';

// init Mink and register sessions
$mink = new Mink(
    'goutte1'    => new Session(new GoutteDriver($startUrl)),
    'goutte2'    => new Session(new GoutteDriver($startUrl)),
    'javascript' => new Session(new SahiDriver($startUrl, 'firefox')),
    'custom'     => new Session(new MyCustomDriver($startUrl))
);

// set default session name
$mink->setDefaultSessionName('goutte2');

// call getSession without argument will always return default session if has one (goutte2 here)
$mink->getSession()->getPage()->findLink('Downloads')->click();
echo $mink->getSession()->getPage()->getContent();

// run in javascript (Sahi) session
$mink->getSession('javascript')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('javascript')->getPage()->getContent();

// run in custom session
$mink->getSession('custom')->getPage()->findLink('Downloads')->click();
echo $mink->getSession('custom')->getPage()->getContent();

// mix sessions
$mink->getSession('goutte1')->getPage()->findLink('Chat')->click();
$mink->getSession('goutte2')->getPage()->findLink('Chat')->click();

Translated languages

For now exists 6 translated language: es,fr,ja,nl,pt,ru.

Note: The es and fr are outdated.

How to add a new translated language?

If you want to translate another language, you can use as reference the ru language file under translations folder.

Then add it in MinkContext after line #657.

Important: The filename must match with the same translated language file in Behat and Gherkin in order to work correctly. If the language does not exist in Gherkin and Behat you must add it there too.

Copyright

Copyright (c) 2011 Konstantin Kudryashov (ever.zet). See LICENSE for details.

Contributors

  • Konstantin Kudryashov everzet [lead developer]
  • Pascal Cremer b00giZm [ZombieDriver creator]

Sponsors

mink's People

Contributors

everzet avatar b00gizm avatar schmittjoh avatar zombor avatar mdhooge avatar docteurklein avatar pgodel avatar hidenorigoto avatar arendjantetteroo avatar stof avatar mlively avatar

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.