Skip to content

[Pangolins] Verify travis runs correctly #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ php:
- 7.0
- 7.1
install: composer install --no-interaction --prefer-source
env:
matrix:
- VERIFICATION_TOOL=copyright-check
- VERIFICATION_TOOL=phpunit-checks
- VERIFICATION_TOOL=static-checks
script:
- vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
- bin/$VERIFICATION_TOOL
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"codeception/codeception": "2.2|2.3",
"flow/jsonpath": ">0.2",
"fzaninotto/faker": "^1.6",
"mustache/mustache": "~2.5"
"mustache/mustache": "~2.5",
"epfremme/swagger-php": "^2.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "1.5.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace tests\unit\Magento\FunctionalTestFramework\Test\Util;

use Magento\FunctionalTestingFramework\Exceptions\XmlException;
use Magento\FunctionalTestingFramework\Test\Util\TestNameValidationUtil;
use PHPUnit\Framework\TestCase;

class TestNameValidationUtilTest extends TestCase
{
/**
* Validate name with curly braces throws exception
*/
public function testCurlyBracesInTestName()
{
$this->validateBlacklistedTestName("{{curlyBraces}}");
}

/**
* Validate name with quotation marks throws exception
*/
public function testQuotesInTestName()
{
$this->validateBlacklistedTestName("\"quotes\"");
}

/**
* Validate name with single quotes throws exception
*/
public function testSingleQuotesInTestName()
{
$this->validateBlacklistedTestName("'singleQuotes'");
}

/**
* Validate name with parenthesis throws execption
*/
public function testParenthesesInTestName()
{
$this->validateBlacklistedTestName("(parenthesis)");
}

/**
* Validate name with dollar signs throws exception
*/
public function testDollarSignInTestName()
{
$this->validateBlacklistedTestName("\$dollarSign\$");
}

/**
* Validate name with spaces throws exception
*/
public function testSpacesInTestName()
{
$this->validateBlacklistedTestName("Test Name With Spaces");
}

/**
* Method which takes the name of the test expecting an invalid char. Runs the validation method against name.
*
* @param string $testName
* @return void
*/
private function validateBlacklistedTestName($testName)
{
$this->expectException(XmlException::class);
TestNameValidationUtil::validateName($testName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand Down
1 change: 1 addition & 0 deletions dev/tests/verification/Resources/BasicFunctionalCest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand Down
49 changes: 49 additions & 0 deletions dev/tests/verification/Resources/DataReplacementCest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
namespace Magento\AcceptanceTest\_generated\Backend;

use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
use Yandex\Allure\Adapter\Annotation\Description;
use Yandex\Allure\Adapter\Annotation\Parameter;
use Yandex\Allure\Adapter\Annotation\Severity;
use Yandex\Allure\Adapter\Model\SeverityLevel;
use Yandex\Allure\Adapter\Annotation\TestCaseId;

/**
*/
class DataReplacementCest
{
/**
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
*/
public function DataReplacementTest(AcceptanceTester $I)
{
$I->fillField("#selector", "StringBefore John StringAfter");
$I->fillField("#John", "input");
$I->dragAndDrop("#John", "Doe");
$I->conditionalClick("Doe", "#John", true);
$I->amOnUrl("John.html");
$I->searchAndMultiSelectOption("#selector", ["John", "Doe"]);
$I->fillField("#selector", "StringBefore ".msq("uniqueData")."John StringAfter");
$I->fillField("#".msq("uniqueData")."John", "input");
$I->dragAndDrop("#".msq("uniqueData")."John", msq("uniqueData")."John");
$I->conditionalClick(msq("uniqueData")."John", "#".msq("uniqueData")."John", true);
$I->amOnUrl(msq("uniqueData")."John.html");
$I->searchAndMultiSelectOption("#selector", [msq("uniqueData")."John", "Doe"]);
$I->fillField("#selector", "StringBefore Doe".msq("uniqueData")." StringAfter");
$I->fillField("#Doe".msq("uniqueData"), "input");
$I->dragAndDrop("#Doe".msq("uniqueData"), "Doe".msq("uniqueData"));
$I->conditionalClick("Doe".msq("uniqueData"), "#Doe".msq("uniqueData"), true);
$I->amOnUrl("Doe".msq("uniqueData").".html");
$I->searchAndMultiSelectOption("#selector", ["John", "Doe".msq("uniqueData")]);
$I->searchAndMultiSelectOption("#selector", [msq("uniqueData")."John", "Doe".msq("uniqueData")]);
}
}
46 changes: 46 additions & 0 deletions dev/tests/verification/Resources/LocatorFunctionCest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
namespace Magento\AcceptanceTest\_generated\Backend;

use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
use Yandex\Allure\Adapter\Annotation\Description;
use Yandex\Allure\Adapter\Annotation\Parameter;
use Yandex\Allure\Adapter\Annotation\Severity;
use Yandex\Allure\Adapter\Model\SeverityLevel;
use Yandex\Allure\Adapter\Annotation\TestCaseId;

/**
*/
class LocatorFunctionCest
{
/**
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
*/
public function LocatorFuctionTest(AcceptanceTester $I)
{
$I->amGoingTo("create entity that has the mergeKey: data");
$ReplacementPerson = DataObjectHandler::getInstance()->getObject("ReplacementPerson");
$data = new DataPersistenceHandler($ReplacementPerson);
$data->createEntity();
$I->click(Locator::contains("'label'", "'Name'"));
$I->click(Locator::contains("'label'", "'Name'"));
$I->click(Locator::find("'img'", ['title' => 'diagram']));
$I->click(Locator::contains("string", "'Name'"));
$I->click(Locator::contains("John", "'Name'"));
$I->click(Locator::contains($data->getCreatedDataByName('key') . "", "'Name'"));
$I->click(Locator::contains("string1", "string2"));
$I->click(Locator::contains("John", "Doe"));
$I->click(Locator::contains($data->getCreatedDataByName('key1') . "", "" . $data->getCreatedDataByName('key2')));
$I->click(Locator::contains("string1", "John"));
$I->click(Locator::contains("string1", "" . $data->getCreatedDataByName('key1')));
$I->click(Locator::contains("John", "" . $data->getCreatedDataByName('key1')));
}
}
1 change: 1 addition & 0 deletions dev/tests/verification/Resources/MergeFunctionalCest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand Down
42 changes: 42 additions & 0 deletions dev/tests/verification/Resources/PageReplacementCest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
namespace Magento\AcceptanceTest\_generated\Backend;

use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
use Yandex\Allure\Adapter\Annotation\Description;
use Yandex\Allure\Adapter\Annotation\Parameter;
use Yandex\Allure\Adapter\Annotation\Severity;
use Yandex\Allure\Adapter\Model\SeverityLevel;
use Yandex\Allure\Adapter\Annotation\TestCaseId;

/**
*/
class PageReplacementCest
{
/**
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
*/
public function PageReplacementTest(AcceptanceTester $I)
{
$I->amGoingTo("create entity that has the mergeKey: datakey");
$simpleData = DataObjectHandler::getInstance()->getObject("simpleData");
$datakey = new DataPersistenceHandler($simpleData);
$datakey->createEntity();
$I->amOnPage("/page.html");
$I->amOnPage("/StringLiteral/page.html");
$I->amOnPage("/John/page.html");
$I->amOnPage("/" . $datakey->getCreatedDataByName('firstname') . "/page.html");
$I->amOnPage("/StringLiteral1/StringLiteral2.html");
$I->amOnPage("/John/StringLiteral2.html");
$I->amOnPage("/John/" . $datakey->getCreatedDataByName('firstname') . ".html");
$I->amOnPage("/" . $datakey->getCreatedDataByName('firstname') . "/StringLiteral2.html");
}
}
1 change: 1 addition & 0 deletions dev/tests/verification/Resources/ParameterArrayCest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand Down
42 changes: 13 additions & 29 deletions dev/tests/verification/Resources/PersistedReplacementCest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand Down Expand Up @@ -38,34 +39,17 @@ class PersistedReplacementCest
*/
public function PersistedReplacementTest(AcceptanceTester $I)
{
$I->amGoingTo("create entity that has the mergeKey: testScopeData");
$ReplacementPerson = DataObjectHandler::getInstance()->getObject("ReplacementPerson");
$testScopeData = new DataPersistenceHandler($ReplacementPerson);
$testScopeData->createEntity();
$I->amGoingTo("create entity that has the mergeKey: uniqueData");
$UniquePerson = DataObjectHandler::getInstance()->getObject("UniquePerson");
$uniqueData = new DataPersistenceHandler($UniquePerson);
$uniqueData->createEntity();
$I->amOnPage("/success/success2.html");
$I->amOnPage($testScopeData->getCreatedDataByName('firstname') . ".html");
$I->amOnPage($this->createData1->getCreatedDataByName('firstname') . ".html");
$I->amOnPage("/" . $testScopeData->getCreatedDataByName('firstname') . "/" . $testScopeData->getCreatedDataByName('lastname') . ".html");
$I->amOnPage("/" . $this->createData1->getCreatedDataByName('firstname') . "/" . $this->createData1->getCreatedDataByName('lastname') . ".html");
$I->click("#element ." . $testScopeData->getCreatedDataByName('firstname'));
$I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " .success");
$I->click("#John-Doe ." . $testScopeData->getCreatedDataByName('lastname'));
$I->click("#" . $testScopeData->getCreatedDataByName('firstname') . " ." . $testScopeData->getCreatedDataByName('lastname'));
$I->click("#" . $this->createData1->getCreatedDataByName('firstname') . " ." . $this->createData1->getCreatedDataByName('lastname'));
$I->fillField("#sample", "Hello " . $testScopeData->getCreatedDataByName('firstname') . " " . $testScopeData->getCreatedDataByName('lastname'));
$I->fillField("#sample", "Hello " . $this->createData1->getCreatedDataByName('firstname') . " " . $this->createData1->getCreatedDataByName('lastname'));
$I->searchAndMultiSelectOption("#selector", [$testScopeData->getCreatedDataByName('lastname')]);
$I->searchAndMultiSelectOption("#selector", [$this->createData1->getCreatedDataByName('lastname')]);
$I->amOnPage($uniqueData->getCreatedDataByName('firstname') . ".html");
$I->amOnPage("/" . $uniqueData->getCreatedDataByName('firstname') . "/" . $uniqueData->getCreatedDataByName('lastname') . ".html");
$I->click("#element ." . $uniqueData->getCreatedDataByName('firstname'));
$I->click("#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
$I->click("#" . $uniqueData->getCreatedDataByName('firstname'));
$I->dragAndDrop($uniqueData->getCreatedDataByName('firstname'), $uniqueData->getCreatedDataByName('firstname'));
$I->dragAndDrop("#element ." . $uniqueData->getCreatedDataByName('firstname'), "#" . $uniqueData->getCreatedDataByName('firstname') . " .success");
$I->amGoingTo("create entity that has the mergeKey: createdData");
$simpleData = DataObjectHandler::getInstance()->getObject("simpleData");
$createdData = new DataPersistenceHandler($simpleData);
$createdData->createEntity();
$I->fillField("#selector", "StringBefore " . $createdData->getCreatedDataByName('firstname') . " StringAfter");
$I->fillField("#" . $createdData->getCreatedDataByName('firstname'), "input");
$I->dragAndDrop("#" . $createdData->getCreatedDataByName('firstname'), $createdData->getCreatedDataByName('lastname'));
$I->conditionalClick($createdData->getCreatedDataByName('lastname'), "#" . $createdData->getCreatedDataByName('firstname'), true);
$I->amOnUrl($createdData->getCreatedDataByName('firstname') . ".html");
$I->searchAndMultiSelectOption("#selector", [$createdData->getCreatedDataByName('firstname') . "", "" . $createdData->getCreatedDataByName('lastname')]);
$I->fillField("#selector", "John " . $createdData->getCreatedDataByName('firstname') . " stringLiteral");
$I->searchAndMultiSelectOption("#selector", [$createdData->getCreatedDataByName('firstname') . "", "John", "stringLiteral"]);
}
}
60 changes: 60 additions & 0 deletions dev/tests/verification/Resources/SectionReplacementCest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
namespace Magento\AcceptanceTest\_generated\Backend;

use Magento\FunctionalTestingFramework\AcceptanceTester;
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Persist\DataPersistenceHandler;
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
use \Codeception\Util\Locator;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
use Yandex\Allure\Adapter\Annotation\Description;
use Yandex\Allure\Adapter\Annotation\Parameter;
use Yandex\Allure\Adapter\Annotation\Severity;
use Yandex\Allure\Adapter\Model\SeverityLevel;
use Yandex\Allure\Adapter\Annotation\TestCaseId;

/**
*/
class SectionReplacementCest
{
/**
* @Parameter(name = "AcceptanceTester", value="$I")
* @param AcceptanceTester $I
* @return void
*/
public function SectionReplacementTest(AcceptanceTester $I)
{
$I->click("#element");
$I->click("#foo");
$I->waitForPageLoad(30);
$I->click("#element .stringLiteral");
$I->click("#stringLiteral1 .stringLiteral2");
$I->click("#stringLiteral1-stringLiteral2 .stringLiteral3");
$I->click("#stringLiteral1-stringLiteral2 .stringLiteral1 [stringLiteral3]");
$I->click("#element .John");
$I->click("#John .Doe");
$I->click("#John-Doe .Tiberius");
$I->click("#John-Doe .John [Tiberius]");
$I->click("#element .".msq("uniqueData")."John");
$I->click("#".msq("uniqueData")."John .stringLiteral2");
$I->click("#".msq("uniqueData")."John-stringLiteral2 .stringLiteral3");
$I->click("#".msq("uniqueData")."John-stringLiteral2 .");
$I->click("#element .Doe".msq("uniqueData"));
$I->click("#Doe".msq("uniqueData")." .stringLiteral2");
$I->click("#Doe".msq("uniqueData")."-stringLiteral2 .stringLiteral3");
$I->click("#Doe".msq("uniqueData")."-stringLiteral2 .Doe");
$I->amGoingTo("create entity that has the mergeKey: createdData");
$simpleData = DataObjectHandler::getInstance()->getObject("simpleData");
$createdData = new DataPersistenceHandler($simpleData);
$createdData->createEntity();
$I->click("#element ." . $createdData->getCreatedDataByName('firstname'));
$I->click("#" . $createdData->getCreatedDataByName('firstname') . " .stringLiteral2");
$I->click("#" . $createdData->getCreatedDataByName('firstname') . "-stringLiteral2 .stringLiteral3");
$I->click("#" . $createdData->getCreatedDataByName('firstname') . "-stringLiteral2 ." . $createdData->getCreatedDataByName('firstname') . " [stringLiteral3]");
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .John");
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .".msq("uniqueData")."John");
$I->click("#stringLiteral1-" . $createdData->getCreatedDataByName('firstname') . " .Doe".msq("uniqueData"));
}
}
Loading