$re = '/.*@company-gherkin:.*/';
$str = ' /**
* #########################
* Gherkin Glue Code
* ########################
*/
@And(/^.*click next.*$/)
def clickNext() {
def selectNext = new TestObject(\'selectNext\')
selectNext.addProperty("xpath", ConditionType.EQUALS, "//button[contains( text(), \'next\')]", true)
WebUI.click(selectNext)
}
/**
* @company-gherkin: Step: go to the list. Description: Navigates to the list.
*/
@Given(/^.*go to the list.*$/)
def goToList() {
// open the browser
openWebBrowser()
WebUI.navigateToUrl(GlobalVariable.G_SiteURL)
}
/**
* @company-gherkin: Step: select (.*) the item. Description: Select something to save, more than likely the usual. \'(.*)\' represents any value from the drop down list.
*/
@And(/^.*select (.*) the item.*$/)
def selectFixture(String fixture) {
if(!fixture || fixture == " ") {
fixture = "theItem"
}
fixture = fixture.trim()
// println "fixture is:"+fixture
// Select iotaa from the drop down list
WebUI.selectOptionByValue(findTestObject(\'path/to/item\'), fixture, false)
}
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php