/** * @param \AcceptanceTester $I */ public function submitASession(AcceptanceTester $I) { $I->am('an attendee'); $I->wantTo('submit a session'); $I->expect('to be able a submit a new session'); // Login user. $I->amOnPage('/user/login'); $I->submitForm('#user-login-form', ['name' => 'user1', 'pass' => '123456']); $I->seeElement('body.user-logged-in'); // Fill session submission. $I->amOnPage('/node/add/session'); $node_title = $this->faker->text(30); $I->fillField('title[0][value]', $node_title); $I->fillCkEditorByName('body[0][value]', $this->faker->text(100)); $I->fillField('field_author[0][target_id]', 'user1 (2)'); $I->selectOption('field_exp_level', 0); $I->selectOption('field_session_track', 'development'); $I->makeScreenshot('session_form'); $I->submitForm('#node-session-form', [], 'op'); $I->makeScreenshot('session_view'); $I->see($node_title, '.l-content'); }
<?php // @group mandatory $I = new AcceptanceTester($scenario); $I->wantTo('ensure that JavaScript works'); $I->amGoingTo('check javascript with a modal'); $I->amOnPage('/en-us'); $I->dontSee('#infoModal'); $I->click('footer .pull-left a'); $I->waitForElementVisible('#infoModal', 3); $I->seeElement('#infoModal'); $I->makeScreenshot('modal'); $I->click('#infoModal .close'); $I->dontSee('#infoModal');
<?php /** * @link http://www.diemeisterei.de/ * @copyright Copyright (c) 2015 diemeisterei GmbH, Stuttgart * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $I = new AcceptanceTester($scenario); $I->wantTo('ensure that responsive mobile layout works'); $I->resizeWindow(320, 568); $I->amOnPage('/'); $I->makeScreenshot('mobile'); $I->click('button.navbar-toggle'); $I->wait(3); $I->seeElement('li.active'); $I->seeLink('Login'); $I->makeScreenshot('mobile-open-menu');
$I->am('student'); $I->wantTo('make sure the hall of fame page displays correctly'); // Navigate to page and confirm things look right $I->amOnPage('/student/hall_of_fame/display_records'); // $I->seeInTitle('Scholar Hall of Fame'); /*$I->seeElement(['xpath' => "//input[@value = 'Important!']"]);*/ $I->seeElement(['xpath' => "//input[@value = 'Your Classroom']"]); $I->seeElement(['xpath' => "//input[@value = 'Your Teacher']"]); $I->seeElement(['xpath' => "//input[@value = 'Your School']"]); $I->seeElement(['xpath' => "//input[@value = 'Your District']"]); $I->seeElement(['xpath' => "//input[@value = 'Your State']"]); $I->seeElement(['xpath' => "//input[@value = 'Your Country']"]); /*$I->seeElement(['xpath' => "//input[@value = 'Millionaire\'s Club']"]);*/ $I->seeElement(['xpath' => "//input[@value = 'Overall']"]); $I->seeElement(['xpath' => "//input[@value = 'Return to Village']"]); $I->makeScreenshot('siHall_of_fame'); // Check a category and return back to the main screen $I->click("//input[@value = 'Your Classroom']"); $I->makeScreenshot('sjHof_classroom'); $I->click('//input[@value = "Back to Categories"]'); /*$I->click("//input[@value = 'Your Teacher']"); $I->makeScreenshot('hof_teacher'); $I->click('//input[@value = "Back to Categories"]'); $I->click("//input[@value = 'Your School']"); $I->makeScreenshot('hof_school'); $I->click('//input[@value = "Back to Categories"]'); $I->click("//input[@value = 'Your District']"); $I->makeScreenshot('hof_district'); $I->click('//input[@value = "Back to Categories"]');
<?php $I = new AcceptanceTester($scenario); $I->am('student'); $I->wantTo('test the options on the top bar'); $I->loadSessionSnapshot('login'); $I->amOnPage('/student/library'); $I->click(['xpath' => "//li[@id='achievements']"]); $I->makeScreenshot('srAchievements'); $I->click(['xpath' => "//*[@id='fancybox-close']"]); $I->wait(3); $I->click(['xpath' => "//*[@id='share-idea']"]); $I->makeScreenshot('ssShare_idea'); $I->click(['xpath' => "//*[@id='fancybox-close']"]); $I->click(['xpath' => "//*[@id='report-bug']"]); $I->makeScreenshot('stReport_bug'); ?>
<?php $I = new AcceptanceTester($scenario); $I->am('student'); $I->wantTo('check books, videos, and magazines'); $I->loadSessionSnapshot('login'); $I->selectOption(['xpath' => "//select[@id='current_module']"], 'Rising Reader'); // check the first book $I->amOnPage('/student/library/bookshelf'); $I->makeScreenshot('rcBookshelf'); $I->click(['xpath' => "//span[@id='71']"]); $I->makeScreenshot('rdBook'); $I->click(['xpath' => "//input[@id='bookshelf']"]); // check the first video $I->amOnPage('/student/video/categories'); $I->makeScreenshot('reVideos'); $I->click(['xpath' => "//div[@id='86']"]); $I->click(['xpath' => "//div[@id='1779']"]); $I->seeElementInDOM(['xpath' => "//*[@id='mediaplayer-1']"]); $I->makeScreenshot('rfVideo'); // check the first magazine $I->amOnPage('/student/magazine/categories'); $I->makeScreenshot('rgMagezine_rack'); $I->click(['xpath' => "//span[@id='79']"]); $I->click(['xpath' => "//div[@id='1750']"]); $I->seeElementInDOM(['xpath' => "//*[@id='magazine-article']"]); $I->makeScreenshot('rhMagezine');
<?php use schmunk42\giiant\tests\_pages\LoginPage; #new schmunk42\giiant\tests\_pages\LoginPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure that crud works with access rules'); $I->amOnPage('/crud/actor'); $I->dontSee('Actor', 'h2'); $I->makeScreenshot('crud-actor-login'); $I->see('Sign in', 'h3'); $I->amGoingTo('try to login with correct credentials'); // TODO: use LoginPage $username = '******'; $password = '******'; $I->fillField('input[name="login-form[login]"]', $username); $I->fillField('input[name="login-form[password]"]', $password); $I->click('Sign in'); $I->waitForElement('#link-logout', 5); #LoginPage::openBy($I); #$loginPage = LoginPage::openBy($I); #$loginPage->login('admin', 'admin'); $I->see('Actor', 'h2'); $I->makeScreenshot('crud-actor');
<?php // @group optional use dmstr\modules\pages\tests\_pages\LoginPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure that Pages works'); $I->expect('no access with guest user'); $I->amOnPage('/pages'); $I->see('Sign in', 'h3'); $I->makeScreenshot('pages-login'); $I->amGoingTo('try to login with correct credentials'); $loginPage = LoginPage::openBy($I); $I->see('Sign in', 'h3'); $loginPage->login('admin', 'admin'); $I->dontSee('Sign in', 'h3'); $I->makeScreenshot('pages-after-login'); $I->amGoingTo('try to view and create pages'); $I->amOnPage('/pages'); $I->see('Pages', 'h1'); $I->makeScreenshot('success-pages-index');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('test the settings page'); $I->loadSessionSnapshot('login'); $I->amOnPage('/student/library'); $I->click(['xpath' => "//li[@id='settings']"]); $I->makeScreenshot('ruSettings');
<?php /** * Acceptance test for the Readorium Quiz Bowl screen. * * @author Andrew Lee */ $I = new AcceptanceTester($scenario); // Set up $I->loadSessionSnapshot('login'); $I->am('student'); $I->wantTo('make sure the quiz bowl screen displays correctly'); // Navigate to page and confirm things look right $I->amOnPage('/student/quiz_bowl'); $I->seeInTitle('Rising Reader Quiz Bowl'); $I->seeElement("//input[@value = 'Rising Reader Page I']"); $I->makeScreenshot('rmQuiz_bowl'); // Open page 1 and make it looks right $I->click(['xpath' => "//input[@value = 'Rising Reader Page I']"]); $I->makeScreenshot('rnQb_page1'); // Back to Categories and check page 2 $I->click(['xpath' => "//input[@value = 'Back to Categories']"]); $I->click(['xpath' => "//input[@value = 'Rising Reader Page II']"]); $I->makeScreenshot('roQb_page2'); // Press the back button to return to the village $I->click(['xpath' => "//input[@value = 'Back']"]); $I->seeInCurrentURL('/student/village');
<?php // @group onlyCrud use tests\_pages\LoginPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure that crudOnly works (no access rules)'); $I->amOnPage('/onlyCrud/country'); $I->see('Countries', 'h1'); $I->makeScreenshot('crud-country'); $I->expectTo('see view, edit and delete button'); $I->seeElementInDOM('[data-key="1"] .glyphicon-file'); $I->seeElementInDOM('[data-key="2"] .glyphicon-pencil'); $I->seeElementInDOM('[data-key="3"] .glyphicon-trash'); $I->amGoingTo('create a Country'); $I->click('New'); $I->see('Country', 'h1'); $I->see('Create', '.btn'); $I->fillField('#country-country', 'Xyzland'); $I->makeScreenshot('crud-pre-create-country'); $I->click('Create'); $I->wait(1); $I->see('Xyzland', 'table'); $I->see('Country', 'table'); $I->makeScreenshot('crud-create-country'); $I->click('Edit'); $I->wait(1); $I->seeInField('#country-country', 'Xyzland'); $I->see('Country', 'h1'); $I->fillField('#country-country', 'Abcstan'); $I->click('Save'); $I->wait(1);
<?php $I = new AcceptanceTester($scenario); $I->am('student'); $I->wantTo('check books, videos, and magazines'); $I->loadSessionSnapshot('login'); $I->selectOption(['xpath' => "//select[@id='current_module']"], 'Scholar'); // check the first book $I->amOnPage('/student/library/bookshelf'); $I->makeScreenshot('scBookshelf'); $I->click(['xpath' => "//span[@id='1']"]); $I->makeScreenshot('sdBook'); $I->click(['xpath' => "//input[@id='bookshelf']"]); // check the first video $I->amOnPage('/student/video/categories'); $I->makeScreenshot('seVideos'); $I->click(['xpath' => "//div[@id='36']"]); $I->click(['xpath' => "//div[@id='1511']"]); $I->seeElementInDOM(['xpath' => "//*[@id='mediaplayer-1']"]); $I->makeScreenshot('sfVideo'); // check the first magazine $I->amOnPage('/student/magazine/categories'); $I->makeScreenshot('sgMagezine_rack'); $I->click(['xpath' => "//span[@id='26']"]); $I->click(['xpath' => "//div[@id='1440']"]); $I->seeElementInDOM(['xpath' => "//*[@id='magazine-article']"]); $I->makeScreenshot('shMagezine');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('sign in'); $I->amOnPage('/user/login'); $I->fillField('#login-form-login', 'admin'); $I->fillField('#login-form-password', 'admin'); $I->click('Sign in', '#login-form'); $I->wait(5); $I->see('admin', '#link-user-menu'); $I->makeScreenshot('login-success');
<?php $I = new AcceptanceTester($scenario); $I->wantTo('ensure that frontpage works'); $I->amOnPage('/'); $I->makeScreenshot('front_page'); $I->see('Home');
<?php $I = new AcceptanceTester($scenario); $I->am('student'); $I->wantTo('ensure that frontpage works'); $I->amOnPage('/'); $I->makeScreenshot('aLogin'); //Testing all the text fields $I->seeInTitle('Readorium Student Login'); $I->seeLink('username'); $I->seeLink('password'); //Fill fields $I->fillField(['xpath' => "//input[@name='userid']"], 'juth'); $I->fillField(['xpath' => "//input[@name='password']"], 'r3aD0riUm'); $I->fillField(['xpath' => "//input[@name='classroomid']"], '1'); $I->click('Login'); $I->makeScreenshot('bLibrary'); $I->saveSessionSnapshot('login');
<?php /** * @link http://www.diemeisterei.de/ * @copyright Copyright (c) 2015 diemeisterei GmbH, Stuttgart * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ $I = new AcceptanceTester($scenario); $I->wantTo('ensure that language urls and redirects work'); $I->amOnPage('/'); $I->seeCurrentUrlEquals('/en/user/login'); $I->amOnPage('/de'); $I->seeCurrentUrlEquals('/de/user/login'); $I->see('Anmelden'); $I->makeScreenshot('language-de'); $I->amOnPage('/en-us'); $I->see('Not Found');
<?php /** * Acceptance test for the Readorium Word Wizard World screen. * * @author Andrew Lee */ $I = new AcceptanceTester($scenario); // Set up $I->loadSessionSnapshot('login'); $I->am('student'); $I->wantTo('make sure the word wizard world page displays correctly'); // Navigate to page and confirm things look right $I->amOnPage('/student/word_wizard_world'); $I->seeInTitle('Rising Reader Word Wizard World'); $I->makeScreenshot('rkWord_wizard_world'); // Check each category return back to the main screen $I->click('//input[@value = "Earth Science"]'); $I->makeScreenshot('rlWww_earth'); $I->click('//input[@value = "Back to Categories"]'); /*$I->click('//input[@value = "History and Nature of Science"]'); $I->makeScreenshot('www_history'); $I->click('//input[@value = "Back to Categories"]'); $I->click('//input[@value = "Life Science"]'); $I->makeScreenshot('www_life'); $I->click('//input[@value = "Back to Categories"]'); $I->click('//input[@value = "Physical Science"]'); $I->makeScreenshot('www_physical'); $I->click('//input[@value = "Back to Categories"]');
<?php // @group mandatory $I = new AcceptanceTester($scenario); $I->wantTo('ensure that home page is not visible without login'); $I->amOnPage(Yii::$app->homeUrl); $I->see('Sign in', '.panel.panel-default'); $I->seeLink('Login'); $I->makeScreenshot('home');
<?php use tests\codeception\_pages\AboutPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure that preview access works'); $I->amOnPage('/'); $I->makeScreenshot('debug-preview-access-login'); $loginPage = \tests\codeception\_pages\LoginPage::openBy($I); $I->amGoingTo('try to login as preview'); $loginPage->login('preview', 'preview1234'); $I->amOnPage('/'); $I->dontSee('.alert'); $I->makeScreenshot('success-preview-access');
<?php /** * Acceptance test for the Readorium Game Garage screen. * * @author Andrew Lee */ $I = new AcceptanceTester($scenario); // Set up $I->loadSessionSnapshot('login'); $I->am('student'); $I->wantTo('make sure the game garage page displays correctly'); // Navigate to page and confirm things look right $I->amOnPage('/student/game_garage'); $I->seeInTitle('Rising Reader Game Garage'); $I->seeElement("//div[@id='c2canvasdiv']/input[@type='button'][1]"); $I->makeScreenshot('spGame_garage'); // Open the first game $I->click(['xpath' => "//div[@id='c2canvasdiv']/input[@type='button'][1]"]); $I->makeScreenshot('sqGg_game1'); // Go back to main game page in order to test more games $I->amOnPage('/student/game_garage'); // $I->click(['xpath' => "//div[@id='c2canvasdiv']/input[@type='button'][3]"]); // $I->makeScreenshot('gg_game2'); // $I->amOnPage('/student/game_garage'); // $I->click(['xpath' => "//div[@id='c2canvasdiv']/input[@type='button'][4]"]); // $I->makeScreenshot('gg_game3'); // $I->amOnPage('/student/game_garage'); // Press the back button to return to the village $I->click(['xpath' => "//div[@id='c2canvasdiv']/input[@type='button'][2]"]);
<?php /** * Acceptance test for the Readorium Quiz Bowl screen. * * @author Andrew Lee */ $I = new AcceptanceTester($scenario); // Set up $I->loadSessionSnapshot('login'); $I->am('student'); $I->wantTo('make sure the quiz bowl screen displays correctly'); // Navigate to page and confirm things look right $I->amOnPage('/student/quiz_bowl'); $I->seeInTitle('Rising Reader Quiz Bowl'); $I->seeElement("//input[@value = 'Earth Science']"); $I->makeScreenshot('smQuiz_bowl'); // Open page 1 and make it looks right $I->click(['xpath' => "//input[@value = 'Earth Science']"]); $I->makeScreenshot('snQb_page1'); // Back to Categories and check page 2 $I->click(['xpath' => "//input[@value = 'Back to Categories']"]); // $I->makeScreenshot('oQb_page2'); // Press the back button to return to the village $I->click(['xpath' => "//input[@value = 'Back']"]); $I->seeInCurrentURL('/student/village');
<?php #use dmstr\modules\pages\tests\_pages\LoginPage; $I = new AcceptanceTester($scenario); $I->wantTo('ensure that Pages works'); #$loginPage = LoginPage::openBy($I); #$I->see('Sign in', 'h3'); #$I->amGoingTo('try to login with correct credentials'); #$loginPage->login('admin', 'admin'); $I->amGoingTo('try to view and create pages'); $I->amOnPage('/pages'); $I->wait(1); $I->see('Nodes', '.kv-heading-container'); $I->makeScreenshot('success-pages-index'); $I->click('.kv-create-root'); #$I->waitForElementNotVisible('.form-vertical'); $I->waitForElementVisible('.form-vertical'); #$I->wait(3); // only for selenium $I->see('General'); $I->see('Route'); $I->fillField('#tree-domain_id', uniqid('test-')); $I->fillField('#tree-name', 'Test'); $I->click('Save'); $I->waitForElementVisible('.kv-tree'); $I->click('.kv-node-detail'); $I->waitForElementVisible('#pages-detail-panel h3'); $I->see('Test', '#pages-detail-panel h3'); $I->makeScreenshot('success-pages-create-root'); $I->click('#w0-detail'); $I->click('.kv-create'); $I->waitForElementVisible('.form-vertical');