Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F848878
custom
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 20, 9:19 AM
Size
4 KB
Mime Type
text/x-diff
Expires
Tue, Apr 22, 9:19 AM (18 h, 34 m)
Engine
blob
Format
Raw Data
Handle
603450
Attached To
rMCUS Modules.Custom
custom
View Options
Index: branches/1.2.x/tests/pages/UserRegistrationPage.php
===================================================================
--- branches/1.2.x/tests/pages/UserRegistrationPage.php (nonexistent)
+++ branches/1.2.x/tests/pages/UserRegistrationPage.php (revision 16762)
@@ -0,0 +1,19 @@
+<?php
+
+use QATools\QATools\HtmlElements\Element\Button;
+
+/**
+ * @page-url('platform/login/register', 'params' => array('p1' => 'v1'))
+ */
+final class UserRegistrationPage extends Page
+{
+
+ /**
+ * Registration button.
+ *
+ * @var Button
+ * @find-by('name' => 'events[u.login-sidebox][OnLogin]')
+ */
+ public $loginButton;
+
+}
Property changes on: branches/1.2.x/tests/pages/UserRegistrationPage.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: branches/1.2.x/tests/SampleWorkflowTest.php
===================================================================
--- branches/1.2.x/tests/SampleWorkflowTest.php (nonexistent)
+++ branches/1.2.x/tests/SampleWorkflowTest.php (revision 16762)
@@ -0,0 +1,40 @@
+<?php
+
+
+use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains;
+
+class SampleWorkflowTest extends AbstractBrowserTestCase
+{
+
+ use AssertStringContains;
+
+ public function testSampleWithoutPageObjects()
+ {
+ $session = $this->getSession();
+
+ $url = $this->Application->HREF('platform/login/register', '', array('no_amp' => 1));
+ $session->visit($url);
+
+ $page = $session->getPage();
+ $content_box_titles = $page->findAll('css', '.content-box-title');
+
+ if ( !$content_box_titles ) {
+ $this->fail('No content boxes found on the page');
+ }
+
+ $content_box_title = array_shift($content_box_titles);
+
+ $this->assertEquals('User Registration', trim($content_box_title->getText()));
+ }
+
+ public function testSampleWithPageObjects()
+ {
+ $user_registration_page = new UserRegistrationPage($this->pageFactory);
+ $user_registration_page->open();
+
+ $user_registration_page->loginButton->click();
+
+ $this->assertStringContainsString('Incorrect Username or Password', $user_registration_page->getText());
+ }
+
+}
Property changes on: branches/1.2.x/tests/SampleWorkflowTest.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: branches/1.2.x/tests/SampleUnitTest.php
===================================================================
--- branches/1.2.x/tests/SampleUnitTest.php (nonexistent)
+++ branches/1.2.x/tests/SampleUnitTest.php (revision 16762)
@@ -0,0 +1,32 @@
+<?php
+
+
+class SampleUnitTest extends AbstractTestCase
+{
+
+ /**
+ * @before
+ */
+ public function setUpTest()
+ {
+
+ }
+
+ /**
+ * @after
+ */
+ public function tearDownTest()
+ {
+
+ }
+
+ public function testSample()
+ {
+ $this->assertEquals(
+ '/admin',
+ kUtil::getSystemConfig()->get('AdminDirectory'),
+ 'Default admin directory is wrong'
+ );
+ }
+
+}
Property changes on: branches/1.2.x/tests/SampleUnitTest.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: branches/1.2.x/tests/tests_config.php
===================================================================
--- branches/1.2.x/tests/tests_config.php (nonexistent)
+++ branches/1.2.x/tests/tests_config.php (revision 16762)
@@ -0,0 +1,12 @@
+<?php
+defined('FULL_PATH') or die('restricted access!');
+
+$config = array(
+ 'Prefix' => 'custom-tests',
+
+ 'EventHandlerClass' => array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => array(
+ array('pseudo' => 'UserRegistrationPage', 'class' => 'UserRegistrationPage', 'file' => 'pages/UserRegistrationPage.php'),
+ ),
+);
Property changes on: branches/1.2.x/tests/tests_config.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Event Timeline
Log In to Comment