Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
f0a9a781
Commit
f0a9a781
authored
11 years ago
by
Kurund Jalmi
Browse files
Options
Downloads
Patches
Plain Diff
whitespace fixes
parent
1f65e71e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php
+30
-28
30 additions, 28 deletions
...nit/WebTest/Event/MultipleEventRegistrationbyCartTest.php
with
30 additions
and
28 deletions
tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php
+
30
−
28
View file @
f0a9a781
...
...
@@ -31,7 +31,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
parent
::
setUp
();
}
function
testAuthenticatedMultipleEvent
(){
function
testAuthenticatedMultipleEvent
()
{
// Log in using webtestLogin() method
$this
->
webtestLogin
();
...
...
@@ -113,17 +113,18 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$value
=
$this
->
_testCheckOut
();
//three event names
$events
=
array
(
1
=>
$eventTitle1
,
2
=>
$eventTitle2
,
3
=>
$eventTitle3
,
);
$events
=
array
(
1
=>
$eventTitle1
,
2
=>
$eventTitle2
,
3
=>
$eventTitle3
,
);
//check the existence of the contacts who were registered and the one who did the contribution
$this
->
_checkContributionsandEventRegistration
(
$value
[
0
],
$value
[
1
],
$events
);
$this
->
_checkContributionsandEventRegistration
(
$value
[
0
],
$value
[
1
],
$events
);
}
function
testAnonymousMultipleEvent
(){
// This is the path where our testing install resides.
function
testAnonymousMultipleEvent
()
{
// This is the path where our testing install resides.
// The rest of URL is defined in CiviSeleniumTestCase base class, in
// class attributes.
...
...
@@ -215,13 +216,14 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$this
->
openCiviPage
(
"dashboard"
,
"reset=1"
);
//three event names
$events
=
array
(
1
=>
$eventTitle1
,
2
=>
$eventTitle2
,
3
=>
$eventTitle3
,
);
$events
=
array
(
1
=>
$eventTitle1
,
2
=>
$eventTitle2
,
3
=>
$eventTitle3
,
);
//check the existence of the contacts who were registered and the one who did the contribution
$this
->
_checkContributionsandEventRegistration
(
$value
[
0
],
$value
[
1
],
$events
);
$this
->
_checkContributionsandEventRegistration
(
$value
[
0
],
$value
[
1
],
$events
);
}
function
_testAddEventInfo
(
$eventTitle
,
$eventDescription
)
{
...
...
@@ -273,7 +275,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$this
->
waitForElementPresent
(
"_qf_Fee_upload-bottom"
);
$this
->
click
(
"CIVICRM_QFID_1_is_monetary"
);
$this
->
click
(
"xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='
$processorName
']"
);
$this
->
select
(
'financial_type_id'
,
'Event Fee'
);
$this
->
select
(
'financial_type_id'
,
'Event Fee'
);
if
(
$priceSet
)
{
// get one - TBD
}
...
...
@@ -293,8 +295,8 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$this
->
webtestFillDate
(
"discount_start_date_1"
,
"-1 week"
);
$this
->
webtestFillDate
(
"discount_end_date_1"
,
"+2 week"
);
$this
->
clickLink
(
"_qf_Fee_submit"
,
"discounted_value_2_1"
);
$this
->
type
(
"discounted_value_1_1"
,
"225.00"
);
$this
->
type
(
"discounted_value_2_1"
,
"300.00"
);
$this
->
type
(
"discounted_value_1_1"
,
"225.00"
);
$this
->
type
(
"discounted_value_2_1"
,
"300.00"
);
$this
->
click
(
"xpath=//fieldset[@id='discount']/fieldset/table/tbody/tr[2]/td[3]/input"
);
}
...
...
@@ -368,7 +370,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$this
->
waitForPageToLoad
(
$this
->
getTimeoutMsec
());
}
function
_testCheckOut
(){
function
_testCheckOut
()
{
//View the Cart
$this
->
click
(
"xpath=//div[@id='messages']/div/div/a[text()='View your cart.']"
);
...
...
@@ -377,11 +379,11 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
$this
->
click
(
"xpath=//a[@class='button crm-check-out-button']/span"
);
$this
->
waitForPageToLoad
(
$this
->
getTimeoutMsec
());
$firstName
=
"AB"
.
substr
(
sha1
(
rand
()),
0
,
7
);
$lastName
=
"XY"
.
substr
(
sha1
(
rand
()),
0
,
7
);
for
(
$i
=
1
;
$i
<=
3
;
$i
++
){
$this
->
type
(
"xpath=//form[@id='ParticipantsAndPrices']/fieldset[
$i
]/div/fieldset/div/div/fieldset/div/div[2]/input"
,
"
{
$firstName
}
.
{
$lastName
}
@home.com"
);
$this
->
type
(
"xpath=//form[@id='ParticipantsAndPrices']/fieldset[
$i
]/div/fieldset/div/div[2]/div[2]/input"
,
"
{
$firstName
}
.
{
$lastName
}
@example.com"
);
$firstName
=
"AB"
.
substr
(
sha1
(
rand
()),
0
,
7
);
$lastName
=
"XY"
.
substr
(
sha1
(
rand
()),
0
,
7
);
for
(
$i
=
1
;
$i
<=
3
;
$i
++
)
{
$this
->
type
(
"xpath=//form[@id='ParticipantsAndPrices']/fieldset[
$i
]/div/fieldset/div/div/fieldset/div/div[2]/input"
,
"
{
$firstName
}
.
{
$lastName
}
@home.com"
);
$this
->
type
(
"xpath=//form[@id='ParticipantsAndPrices']/fieldset[
$i
]/div/fieldset/div/div[2]/div[2]/input"
,
"
{
$firstName
}
.
{
$lastName
}
@example.com"
);
$this
->
click
(
"xpath=//form[@id='ParticipantsAndPrices']/fieldset[
$i
]/div[2]/div[2]/input[2]"
);
}
$this
->
click
(
"_qf_ParticipantsAndPrices_upload-bottom"
);
...
...
@@ -407,10 +409,10 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
return
array
(
$firstName
,
$lastName
);
}
function
_checkContributionsandEventRegistration
(
$firstName
,
$lastName
,
$events
){
function
_checkContributionsandEventRegistration
(
$firstName
,
$lastName
,
$events
)
{
//Type the registered participant's email in autocomplete.
$this
->
click
(
'sort_name_navigation'
);
$this
->
type
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@home.com"
);
$this
->
type
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@home.com"
);
$this
->
typeKeys
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@home.com"
);
// Wait for result list.
...
...
@@ -423,18 +425,18 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
//click on Events Tab
$this
->
click
(
"xpath=//li[@id='tab_participant']/a"
);
//check if the participant is registered for all the three events
foreach
(
$events
as
$key
=>
$value
){
foreach
(
$events
as
$key
=>
$value
)
{
$this
->
waitForElementPresent
(
"link=
$value
"
);
$this
->
assertTrue
(
$this
->
isElementPresent
(
"link=
$value
"
));
}
for
(
$i
=
1
;
$i
<=
3
;
$i
++
){
for
(
$i
=
1
;
$i
<=
3
;
$i
++
)
{
$this
->
waitForElementPresent
(
"xpath=//table[@class='selector']/tbody/tr[
$i
]/td[6][text()='Registered']"
);
$this
->
assertTrue
(
$this
->
isElementPresent
(
"xpath=//table[@class='selector']/tbody/tr[
$i
]/td[6][text()='Registered']"
));
}
//Type the billing email in autocomplete.
$this
->
click
(
'sort_name_navigation'
);
$this
->
type
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@example.com"
);
$this
->
type
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@example.com"
);
$this
->
typeKeys
(
'css=input#sort_name_navigation'
,
"
{
$firstName
}
.
{
$lastName
}
@example.com"
);
// Wait for result list.
...
...
@@ -447,7 +449,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
//click on Contributions Tab
$this
->
click
(
"xpath=//li[@id='tab_contribute']/a"
);
//check for the three contributions
foreach
(
$events
as
$key
=>
$value
){
foreach
(
$events
as
$key
=>
$value
)
{
$this
->
waitForElementPresent
(
"xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'
$value
')]"
);
$this
->
assertTrue
(
$this
->
isElementPresent
(
"xpath=//table[@class='selector']/tbody/tr/td[3][contains(text(),'
$value
')]"
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment