Write selenium tests using XML (includes Page Object pattern)
Write selenium tests using XML
<layouts>
<layout id="siteLayout">
<po id="footer" css="#footer">
<el id="cookiePolicy" css="a['/cookie/policy']" ></el>
<el id="privacy" css="a['/privacy']" ></el>
<el id="terms" css="a['/terms']" ></el>
</po>
</layout>
<layout id="notLoggedInLayout" extends="siteLayout">
<po id="header" css="#header">
<el id="logo" css="a" ></el>
<el id="search" css="name['query']" ></el>
<el id="home" css="ul a[href='/']" ></el>
<el id="login" css="ul a[href='/login']" ></el>
<el id="createAccount" css="ul a[href='/create/account']" ></el>
</po>
</layout>
<layout id="loggedInLayout" extends="siteLayout">
<po id="header" css="#header">
<el id="profile" css="ul a[href='/my/profile']" ></el>
<el id="logout" css="ul a[href='/logout']" ></el>
</po>
</layout>
</layouts>
<pages>
<page id="homePage" layout="notLoggedInLayout">
<po id="content">
<el id="forgotPassword" css="a[href='/forgot/password']" ></el>
<po id="login" css="#login">
<el id="email" css="[name='email']" ></el>
<el id="password" css="[name='password']" ></el>
<el id="rememberme" css="[name='rememberme']" ></el>
<el id="submit" css="[type='submit']" ></el>
</po>
<po id="register" css="#register">
<el id="email" css="[name='email']" ></el>
<el id="password" css="[name='password']" ></el>
<el id="reTypePassword" css="[name='reTypePassword']" ></el>
<el id="agreeWithTerms" css="[name='agreeWithTerms']" ></el>
<el id="submit" css="[type='submit']" ></el>
</po>
</po>
</page>
<page id="logedInHomePage" layout="loggedInLayout">
</page>
</pages>
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template id="loginTemplate">
<type el="login email" value="test53@stasha.info" ></type>
<type el="login password" value="password" ></type>
<select el="login rememberme" value="false" ></select>
<mouse el="login submit" ></mouse>
<assert type="text" css="title">Admastic - Latest ads</assert>
</template>
</templates>
<site baseUri="http://localhost:8080/">
<import file="core/layout.xml" ></import>
<import file="pages/home.xml" ></import>
<import file="core/templates.xml" ></import>
</site>
<tests>
<test id="loginTest">
<navigate url="/" return="homePage" ></navigate>
<mouse type="click" el="header home" ></mouse>
<assert type="text" css="title">Admastic</assert>
<import template="loginTemplate" ></import>
<wait el="header home" until="isVisible" timeout="200" ></wait>
</test>
<test id="logoutTest">
<navigate url="/" return="logedInHomePage" ></navigate>
<mouse el="header logout" return="homePage" ></mouse>
<assert type="text" css="title">Admastic</assert>
</test>
</tests>