Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

Commit f7a1c2d

Browse files
authored
Merge pull request #39 from pritalpatel/fix_issue_#37
Fix issue #37
2 parents c426857 + 9dd70e7 commit f7a1c2d

File tree

4 files changed

+34
-140
lines changed

4 files changed

+34
-140
lines changed

tests/_support/Step/Acceptance/Administrator/Content.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public function iSaveAnArticle()
3737
}
3838

3939
/**
40-
* @Then I wait for the title :title and see the message :message
40+
* @Then I should see the :arg1 message
4141
*/
42-
public function iShouldSeeTheMessage($title, $message)
42+
public function iShouldSeeTheMessage($message)
4343
{
4444
$I = $this;
45-
$I->waitForPageTitle($title);
45+
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
4646
$I->see($message, AdminPage::$systemMessageContainer);
4747
}
4848

@@ -67,16 +67,6 @@ public function iFeatureTheContentWithTitle()
6767
$I->clickToolbarButton('featured');
6868
}
6969

70-
/**
71-
* @Then I save and see the :arg1 message
72-
*/
73-
/*public function iSaveAndSeeTheMessage($message)
74-
{
75-
$I = $this;
76-
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer);
77-
$I->see($message, AdminPage::$systemMessageContainer);
78-
}*/
79-
8070
/**
8171
* @Given I select the content article with title :arg1
8272
*/
@@ -109,7 +99,7 @@ public function iSaveTheArticle()
10999
}
110100

111101
/**
112-
* @Given I have article with name :arg1
102+
* @Given I have article with name :title
113103
*/
114104
public function iHaveArticleWithName($title)
115105
{
@@ -169,4 +159,4 @@ public function iSeeArticleTrashMessage($title, $message)
169159
$I->waitForPageTitle($title);
170160
$I->see($message, AdminPage::$systemMessageContainer);
171161
}
172-
}
162+
}

tests/_support/Step/Acceptance/Administrator/User.php

Lines changed: 5 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function iCreateNewUser($name, $username, $password, $email)
3333
}
3434

3535
/**
36-
* @When I Save the user
36+
* @When I Save the user
3737
*/
3838
public function iSaveTheUser()
3939
{
@@ -42,12 +42,12 @@ public function iSaveTheUser()
4242
}
4343

4444
/**
45-
* @Then I should wait for the title :title and see the message :message
45+
* @Then I should see the :arg1 message
4646
*/
47-
public function iSeeTheMessage($title, $message)
47+
public function iSeeTheMessage($message)
4848
{
4949
$I = $this;
50-
$I->waitForPageTitle($title);
50+
$I->waitForText($message, 60, AdminPage::$systemMessageContainer);
5151
$I->see($message, AdminPage::$systemMessageContainer);
5252
}
5353

@@ -77,17 +77,6 @@ public function iAssignedNameAndUserGroup($name, $userGroup)
7777
$I->checkOption('#1group_4');
7878
}
7979

80-
/**
81-
* @Then I should wait for :arg1 title and see the :arg2 message
82-
*/
83-
public function iShouldDisplayTheMessage($title, $message)
84-
{
85-
$I = $this;
86-
$I->clickToolbarButton('Save & Close');
87-
$I->waitForPageTitle($title);
88-
$I->see($message, AdminPage::$systemMessageContainer);
89-
}
90-
9180
/**
9281
* @Given I have a user with user name :username
9382
*/
@@ -109,16 +98,6 @@ public function iBlockTheUser()
10998
$I->clickToolbarButton('unpublish');
11099
}
111100

112-
/**
113-
* @Then I wait for the title :title and see the message :message
114-
*/
115-
public function iShouldSeeTheUserBlockMessage($title, $message)
116-
{
117-
$I = $this;
118-
$I->waitForPageTitle($title);
119-
$I->see($message, AdminPage::$systemMessageContainer);
120-
}
121-
122101
/**
123102
* @Given I have a blocked user with user name :username
124103
*/
@@ -137,20 +116,9 @@ public function iHaveABlockedUserWithUserName($username)
137116
public function iUnblockTheUser()
138117
{
139118
$I = $this;
140-
$I->waitForPageTitle('Users');
141119
$I->clickToolbarButton('unblock');
142120
}
143121

144-
/**
145-
* @Then I should see the user unblock message :message
146-
*/
147-
/*public function iShouldSeeTheUserUnblockMessage($message)
148-
{
149-
$I = $this;
150-
$I->waitForPageTitle($message, AdminPage::$systemMessageContainer);
151-
$I->see($message, AdminPage::$systemMessageContainer);
152-
}*/
153-
154122
/**
155123
* @When I Delete the user :username
156124
*/
@@ -165,17 +133,6 @@ public function iDeleteTheUser($username)
165133
$I->acceptPopup();
166134
}
167135

168-
/**
169-
* @Then I confirm the user should have been deleted by getting the title :title and see the message :message
170-
*/
171-
public function iConfirmTheUserDeleteSucessfully($title, $message)
172-
{
173-
$I = $this;
174-
$I->checkForPhpNoticesOrWarnings();
175-
$I->waitForPageTitle($title);
176-
$I->see($message, AdminPage::$systemMessageContainer);
177-
}
178-
179136
/**
180137
* @Given There is an user link
181138
*/
@@ -226,7 +183,7 @@ public function iSetAssignedUserGroupAsAnAdministrator()
226183
$I->click('Assigned User Groups');
227184
$I->checkOption('#1group_7');
228185
}
229-
186+
230187
/**
231188
* @Then Login in backend with username :username and password :password
232189
*/
@@ -298,16 +255,6 @@ public function iSaveTheGroup()
298255
$I->clickToolbarButton('Save & Close');
299256
}
300257

301-
/**
302-
* @Then I should wait for :title title and see the message :message
303-
*/
304-
public function iShouldSeeTheMessage($title, $message)
305-
{
306-
$I = $this;
307-
$I->waitForPageTitle($title);
308-
$I->see($message, AdminPage::$systemMessageContainer);
309-
}
310-
311258
/**
312259
* @Given I search and select the Group with name :grouptitle
313260
*/
@@ -330,7 +277,6 @@ public function iSetGroupTitleAsA($GroupTitle)
330277
$I->fillField(UserManagerPage::$title, $GroupTitle);
331278
}
332279

333-
334280
/**
335281
* @When I Delete the Group :arg1
336282
*/
@@ -345,17 +291,6 @@ public function iDeleteTheGroup($GroupTitle)
345291
$I->acceptPopup();
346292
}
347293

348-
/**
349-
* @Then I confirm the group should have been deleted by getting the title :title and see the message :message
350-
*/
351-
public function iDeleteUserGroup($title, $message)
352-
{
353-
$I = $this;
354-
$I->checkForPhpNoticesOrWarnings();
355-
$I->waitForPageTitle($title);
356-
$I->see($message, AdminPage::$systemMessageContainer);
357-
}
358-
359294
/**
360295
* @Given There is a add viewing access level link
361296
*/
@@ -385,16 +320,6 @@ public function iSaveTheAccessLevel()
385320
$I->clickToolbarButton('Save & Close');
386321
}
387322

388-
/**
389-
* @Then I wait for the title :title see the message :message
390-
*/
391-
public function iShouldBeSeeTheMessage($title, $message)
392-
{
393-
$I = $this;
394-
$I->waitForPageTitle($title);
395-
$I->see($message, AdminPage::$systemMessageContainer);
396-
}
397-
398323
/**
399324
* @Given I search and select the Access Level with name :leveltitle
400325
*/
@@ -417,15 +342,6 @@ public function iSetAccessLevelTitleAsA($LevelTitle)
417342
$I->fillField(UserManagerPage::$title, $LevelTitle);
418343
}
419344

420-
/**
421-
* @When I save Access Level
422-
*/
423-
public function iSaveAccessLevel()
424-
{
425-
$I = $this;
426-
$I->clickToolbarButton('Save & Close');
427-
}
428-
429345
/**
430346
* @When I Delete the Access level :leveltitle
431347
*/
@@ -440,16 +356,6 @@ public function iDeleteTheAccessLeVel($LevelTitle)
440356
$I->acceptPopup();
441357
}
442358

443-
/**
444-
* @Then I confirm the Access Level have been deleted by getting the title :title and see the message :message
445-
*/
446-
public function iDeleteAccessLevel($title, $message)
447-
{
448-
$I = $this;
449-
$I->checkForPhpNoticesOrWarnings();
450-
$I->waitForPageTitle($title);
451-
$I->see($message, AdminPage::$systemMessageContainer);
452-
}
453359
/**
454360
* @Given There is a User link
455361
*/
@@ -496,6 +402,4 @@ public function iShouldBeSeeTheLinkCreateAnAccountInFrontend()
496402
$I = $this;
497403
$I->click(['class' => 'brand visible-desktop visible-tablet']);
498404
}
499-
500-
501405
}

tests/acceptance/content.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@ Feature: content
1212
Given There is a add content link
1313
When I create new content with field title as "My_Article" and content as a "This is my first article"
1414
And I save an article
15-
Then I wait for the title "Articles" and see the message "Article successfully saved."
15+
Then I should see the "Article successfully saved." message
1616

1717
Scenario: Feature an Article
1818
Given I search and select content article with title "My_Article"
1919
When I featured the article
20-
Then I wait for the title "Articles" and see the message "1 article featured."
20+
Then I should see the "1 article featured." message
2121

2222
Scenario: Modify an article
2323
Given I select the content article with title "My_Article"
2424
And I set access level as a "Registered"
2525
When I save the article
26-
Then I wait for the title "Articles" and see the message "Article successfully saved."
26+
Then I should see the "Article successfully saved." message
2727

2828
Scenario: Unpublish an article
2929
Given I have article with name "My_Article"
3030
When I unpublish the article
31-
Then I wait for title "Articles" and see the unpublish message "1 article unpublished."
31+
Then I should see the "1 article unpublished." message
3232

3333
Scenario: Trash an article
3434
Given I have "My_Article" content article which needs to be Trash
3535
When I Trash the article
36-
Then I wait for the title "Articles" and see article trash message "1 article trashed."
36+
Then I should see the "1 article trashed." message
3737

tests/acceptance/users.feature

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,77 @@ Feature: users
1616
Scenario: Create a add new user
1717
Given There is a add user link
1818
When I create new user with fields Name "register", Login Name "register", Password "register" and Email "[email protected]"
19-
And I Save the user
20-
Then I should wait for the title "Users" and see the message "User successfully saved."
19+
And I Save the user
20+
Then I should see the "User successfully saved." message
2121

2222
Scenario: Edit user
2323
Given I search and select the user with user name "register"
2424
When I set name as an "Editor" and User Group as "Editor"
25-
And I Save the user
26-
Then I should wait for the title "Users" and see the message "User successfully saved."
25+
And I Save the user
26+
Then I should see the "User successfully saved." message
2727

2828
Scenario: Block a User
2929
Given I have a user with user name "register"
3030
When I block the user
31-
Then I wait for the title "Users" and see the message "User blocked."
31+
Then I should see the "User blocked." message
3232

33-
Scenario: Unblock user
34-
Given I have a blocked user with user name "register"
35-
When I unblock the user
36-
Then I wait for the title "Users" and see the message "User enabled."
33+
# Scenario: Unblock user
34+
# Given I have a blocked user with user name "register"
35+
# When I unblock the user
36+
# Then I should see the "User enabled." message
3737

3838
Scenario: Delete user
3939
Given I have a user with user name "Editor"
4040
When I Delete the user "Editor"
41-
Then I confirm the user should have been deleted by getting the title "Users" and see the message "1 user successfully deleted."
41+
Then I should see the "1 user successfully deleted." message
4242

4343
Scenario: Create super admin and login into the backend
4444
Given There is a add user link
4545
And I fill a super admin with fields Name "prital", Login Name "prital", Password "prital", and Email "[email protected]"
4646
When I set assigned user group as an Administrator
47-
And I Save the user
47+
And I Save the user
4848
Then Login in backend with username "prital" and password "prital"
4949

5050
Scenario: Create User without username fails
5151
Given There is a add user link
5252
When I don't fill Login Name but fulfill remaining mandatory fields: Name "piyu", Password "piyu" and Email "[email protected]"
53-
And I Save the user
53+
And I Save the user
5454
Then I see the title "Users: New"
5555
But I see the alert error "Invalid field: Login Name"
5656

5757
Scenario: Create group
5858
Given There is a add new group link
5959
When I fill Group Title as a "Gsoc"
6060
And I save the Group
61-
Then I should wait for "Users: Groups" title and see the message "Group successfully saved."
61+
Then I should see the "Group successfully saved." message
6262

6363
Scenario: Edit group
6464
Given I search and select the Group with name "Gsoc"
6565
And I set group Title as a "Gsoc_admin"
6666
When I save the Group
67-
Then I should wait for "Users: Groups" title and see the message "Group successfully saved."
67+
Then I should see the "Group successfully saved." message
6868

6969
Scenario: Delete Group
7070
Given I search and select the Group with name "Gsoc_admin"
7171
When I Delete the Group "Gsoc_admin"
72-
Then I confirm the group should have been deleted by getting the title "Users: Groups" and see the message "1 User Group successfully deleted."
72+
Then I should see the "1 User Group successfully deleted." message
7373

7474
Scenario: Create ACL level
7575
Given There is a add viewing access level link
7676
When I fill Level Title as a "joomla" and set Access as a public
7777
And I save the Access Level
78-
Then I wait for the title "Users: Viewing Access Levels" see the message "Access level successfully saved."
78+
Then I should see the "Access level successfully saved." message
7979

8080
Scenario: Edit ACL
8181
Given I search and select the Access Level with name "joomla"
8282
And I set Access Level title as a "Gsoc_joomla"
83-
When I save Access Level
84-
Then I wait for the title "Users: Viewing Access Levels" and see the message "Access level successfully saved."
83+
When I save the Access Level
84+
Then I should see the "Access level successfully saved." message
8585

8686
Scenario: Delete ACL
8787
Given I search and select the Access Level with name "Gsoc_joomla"
8888
When I Delete the Access level "Gsoc_joomla"
89-
Then I confirm the Access Level have been deleted by getting the title "Users: Viewing Access Levels" and see the message "1 View Access Level successfully removed."
89+
Then I should see the "1 View Access Level successfully removed." message
9090

9191
Scenario: User settings (Allow user registration)
9292
Given There is a User link

0 commit comments

Comments
 (0)