Skip to content

Commit

Permalink
Merge pull request #729 from magento/travis-mftf
Browse files Browse the repository at this point in the history
MFTF test runs on travis
  • Loading branch information
sivaschenko authored Nov 19, 2019
2 parents 7973d58 + b0ed6e5 commit d69521f
Show file tree
Hide file tree
Showing 32 changed files with 448 additions and 68 deletions.
83 changes: 63 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,95 @@ addons:
- mysql-client-core-5.6
- mysql-client-5.6
- postfix
firefox: latest
chrome: stable
hosts:
- magento2.travis
services:
- rabbitmq
- elasticsearch
- mysql
language: php
php:
- '7.1'
- '7.2'
- '7.3'
env:
global:
- COMPOSER_BIN_DIR=~/bin
- NODE_JS_VERSION=8
- MAGENTO_HOST_NAME="magento2.travis"
- MAGENTO_PROTOCOL="https"
- MAGENTO_BACKEND="backend"
- MAGENTO_ADMIN_USERNAME="admin"
- MAGENTO_ADMIN_PASSWORD="123123q"
matrix:
- TEST_SUITE=unit
- TEST_SUITE=phpstan
- TEST_SUITE=static
# List out subsets of functional tests to run separately to fit under travis timeout (50mins)
# TODO: this is hacky, is there a better way?
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_filters
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_grid
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_preview
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_configuration
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_keywords
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_ims
- TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_see_more
matrix:
fast_finish: true
jobs:
# only run MFTF tests on PHP 7.3
exclude:
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_filters
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_grid
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_preview
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_configuration
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_keywords
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_ims
- php: '7.1'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_see_more
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_filters
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_grid
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_preview
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_configuration
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_keywords
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_ims
- php: '7.2'
env: TEST_SUITE=functional MFTF_SUITE=adobe_stock_integration_suite_see_more
cache:
directories:
- $HOME/.composer/cache
- $HOME/.nvm
- $HOME/node_modules
- $HOME/yarn.lock
# cache location of webdrivers for MFTF (chromedriver, geckdriver, etc)
- $HOME/drivers
before_install:
- mkdir -p ext/magento/adobe-stock-integration
- mv !(ext) ext/magento/adobe-stock-integration/
- ./ext/magento/adobe-stock-integration/dev/travis/before_install.sh
- bash -x dev/travis/before_install.sh
install:
- cd magento2
- mkdir -p magento2/app/code/Magento
- mv Adobe* magento2/app/code/Magento/.
- pushd magento2
- composer install
- composer config minimum-stability dev
- composer config repositories.ext path "../ext/*/*/*"
- composer require magento/adobe-stock-integration
- composer require astock/stock-api-libphp
- popd
before_script:
- cp ../ext/magento/adobe-stock-integration/dev/tests/unit/phpunit.xml dev/tests/unit/phpunit.xml
- cp -f ../ext/magento/adobe-stock-integration/dev/travis/before_script.sh dev/travis/before_script.sh
- ./dev/travis/before_script.sh
- bash -x dev/travis/before_script.sh
script:
- if [ $TEST_SUITE == 'unit' ]; then phpunit --configuration dev/tests/unit/phpunit.xml; fi
- if [ $TEST_SUITE == 'phpstan' ]; then composer require --dev phpstan/phpstan fooman/phpstan-magento2-magic-methods && phpstan analyse -l 2 ../ext -a dev/tests/api-functional/framework/autoload.php ; fi
- if [ $TEST_SUITE == 'static' ]; then phpcs --standard=dev/tests/static/framework/Magento/ ../ext ; fi
- if [ $TEST_SUITE == 'static' ]; then ! find ../ext -type f -name "*.php" -exec grep -L strict_types=1 {} + | grep ext/magento/adobe-stock-integration/; fi
- pushd magento2
- if [ $TEST_SUITE == 'unit' ]; then vendor/bin/phpunit --configuration dev/tests/unit/phpunit.xml; fi
- if [ $TEST_SUITE == 'phpstan' ]; then composer require --dev phpstan/phpstan fooman/phpstan-magento2-magic-methods && vendor/bin/phpstan analyse -l 2 app/code/Magento/Adobe* -a dev/tests/api-functional/framework/autoload.php ; fi
- if [ $TEST_SUITE == 'static' ]; then vendor/bin/phpcs --standard=dev/tests/static/framework/Magento/ app/code/Magento/Adobe*; fi
- if [ $TEST_SUITE == 'static' ]; then ! find app/code/Magento/Adobe*/ -type f -name "*.php" -exec grep -L strict_types=1 {} + | grep Adobe; fi
- if [ $TEST_SUITE == 'functional' ]; then echo "Running MFTF suite ${MFTF_SUITE}" && vendor/bin/mftf run:group $MFTF_SUITE --remove -vvv; fi
after_success:
- if [ $TEST_SUITE == 'unit' ]; then cd ../ && travis_retry coveralls; fi
after_failure:
- if [ $TEST_SUITE == 'functional' ]; then cat "${HOME}/drivers/*.log" && cat "${TRAVIS_BUILD_DIR}/magento2/var/log/*.log" && cat "${TRAVIS_BUILD_DIR}/var/reports/*"
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/943908/scenarios/3216034"/>
<description value="Admin should be able to configure Adobe Stock Integration"/>
<severity value="CRITICAL"/>
<group value="adobe_stock_integration_general"/>
<group value="adobe_stock_integration_configuration"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/943908/scenarios/3819049"/>
<description value="Admin should see the authentication message error if provided Adobe credentials are wrong"/>
<severity value="MAJOR"/>
<group value="adobe_stock_integration_configuration"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand All @@ -28,7 +29,6 @@
</actionGroup>
</before>
<after>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="AdminOpenMediaGalleryForPageNoEditorActionGroup" stepKey="openMediaGalleryForPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdobeStockImagePreviewSection">
<element name="save" type="block" selector="//button[@class='action-secondary']/span[contains(.,'Save Preview')]"/>
<element name="save" type="block" selector="//button[@class='action-secondary']//span[text()='Save Preview']"/>
<element name="image" type="block" selector="//div[@class='masonry-image-preview']//img"/>
<element name="navigation" type="button" selector="//div[@class='masonry-image-preview']//div[contains(@class, 'action-buttons')]/button[@class='action-{{type}}']" parameterized="true"/>
<element name="attribute" type="block" selector="//*[@id='adobe-stock-images-search-modal']//div[@data-role='image-attributes-value']//span[text()='{{type}}']/parent::div//div[@class='value']//span" parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_configuration">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_configuration"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_filters">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_filters"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_grid">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_grid"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_ims">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_ims"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_keywords">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_keywords"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_preview">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_preview"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
<suite name="adobe_stock_integration_suite_see_more">
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
</after>
<include>
<group name="adobe_stock_integration_see_more"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
<description value="Test to cover scenario: User controls access to Adobe Stock images from Admin Panel in ACL"/>
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/943908/scenarios/3218882"/>
<severity value="MAJOR"/>
<group value="adobe_stock_integration_general"/>
<group value="adobe_stock_integration_configuration"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdminBefore"/>
<actionGroup ref="AdminAdobeStockSetConfigActionGroup" stepKey="setCorrectModuleConfig"/>
</before>
<after>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdminAfter"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<description value="User is able to see the available Adobe Stock images filters"/>
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/943908/scenarios/3222613"/>
<severity value="BLOCKER"/>
<group value="adobe_stock_integration_filters"/>
<group value="adobe_stock_integration_grid"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<description value="User is able to sort Adobe Stock images"/>
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/943908/scenarios/3218851"/>
<severity value="MAJOR"/>
<group value="adobe_stock_integration_sort"/>
<group value="adobe_stock_integration_grid"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<title value="User searches for an image by its keyword tag"/>
<description value="User searches images by clicking on keywords in image preview"/>
<severity value="CRITICAL"/>
<group value="adobe_stock_integration_filters"/>
<group value="adobe_stock_integration_keywords"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/1051731/scenarios/3579522"/>
<description value="Admin should be able to able to see keywords in the image preview"/>
<severity value="MAJOR"/>
<group value="adobe_stock_integration_preview"/>
<group value="adobe_stock_integration_keywords"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<title value="User searches for images from the same model as the currently viewed one"/>
<description value="User sees images with the same model filtered grid"/>
<severity value="CRITICAL"/>
<group value="adobe_stock_integration_preview"/>
<group value="adobe_stock_integration_see_more"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/1051731/scenarios/3579511"/>
<description value="User sees images with the same model"/>
<severity value="CRITICAL"/>
<group value="adobe_stock_integration_preview"/>
<group value="adobe_stock_integration_see_more"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminAdobeStockSeeMoreSeriesFilterTest">
<test name="AdminAdobeStockImagePreviewSameSeriesSeeMoreTest">
<annotations>
<features value="AdobeStockImagePanel"/>
<stories value="[Story #31] User searches for images from the same series as the currently viewed one"/>
Expand All @@ -17,7 +17,7 @@
<testCaseId value="https://app.hiptest.com/projects/131313/test-plan/folders/1051731/scenarios/3579513"/>
<description value="Admin should be able to see more images from series filter"/>
<severity value="CRITICAL"/>
<group value="adobe_stock_integration_filters"/>
<group value="adobe_stock_integration_see_more"/>
<group value="adobe_stock_integration"/>
</annotations>
<before>
Expand Down
Loading

0 comments on commit d69521f

Please sign in to comment.