Skip to content

Instantly share code, notes, and snippets.

@mhauri
Created November 18, 2017 13:23
Show Gist options
  • Save mhauri/0c7d73202e8a3bb0a89bcd86d17394e2 to your computer and use it in GitHub Desktop.
Save mhauri/0c7d73202e8a3bb0a89bcd86d17394e2 to your computer and use it in GitHub Desktop.
MFTM - AdminLoginCest.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<cest name="AdminLoginCest">
<annotations>
<features value="Admin Login"/>
<stories value="Login on the Admin Login page"/>
</annotations>
<test name="LoginAsAdmin">
<annotations>
<title value="You should be able to log into the Magento Admin backend."/>
<description value="You should be able to log into the Magento Admin backend."/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-71572"/>
<group value="example"/>
<group value="login"/>
<env value="chrome"/>
<env value="firefox"/>
<env value="phantomjs"/>
<env value="headless"/>
</annotations>
<!-- Navigate to login page -->
<amOnPage mergeKey="navigateToLoginPage" url="/{{_ENV.MAGENTO_BACKEND_NAME}}" />
<!-- fill username field -->
<fillField mergeKey="fillUsername" selector="{{AdminLoginFormSection.username}}" userInput="{{_ENV.MAGENTO_ADMIN_USERNAME}}" />
<!-- fill password field -->
<fillField mergeKey="fillPassword" selector="{{AdminLoginFormSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" />
<!-- click submit button -->
<click mergeKey="clickSubmitButton" selector="{{AdminLoginFormSection.signIn}}" />
<!-- verify login success-->
<seeInCurrentUrl mergeKey="seeThatWeAreonTheDashboard" url="/{{_ENV.MAGENTO_BACKEND_NAME}}/dashboard" />
</test>
</cest>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment