@@ -93,11 +93,48 @@ public function testSeeInCurrentUrl()
93
93
94
94
public function testSeeLink ()
95
95
{
96
- $ this ->module ->amOnPage ('/ ' );
97
- $ this ->module ->seeLink ('More info ' );
98
- $ this ->module ->dontSeeLink ('/info ' );
99
- $ this ->module ->dontSeeLink ('#info ' );
100
- $ this ->module ->seeLink ('More ' , '/info ' );
96
+ $ this ->module ->amOnPage ('/external_url ' );
97
+ $ this ->module ->seeLink ('Next ' );
98
+ $ this ->module ->seeLink ('Next ' , 'http://codeception.com/ ' );
99
+ }
100
+
101
+ public function testDontSeeLink ()
102
+ {
103
+ $ this ->module ->amOnPage ('/external_url ' );
104
+ $ this ->module ->dontSeeLink ('Back ' );
105
+ $ this ->module ->dontSeeLink ('Next ' , '/fsdfsdf/ ' );
106
+ }
107
+
108
+ public function testSeeLinkFailsIfTextDoesNotMatch ()
109
+ {
110
+ $ this ->setExpectedException ('PHPUnit_Framework_AssertionFailedError ' ,
111
+ "No links containing text 'Codeception' were found in page /external_url " );
112
+ $ this ->module ->amOnPage ('/external_url ' );
113
+ $ this ->module ->seeLink ('Codeception ' );
114
+ }
115
+
116
+ public function testSeeLinkFailsIfHrefDoesNotMatch ()
117
+ {
118
+ $ this ->setExpectedException ('PHPUnit_Framework_AssertionFailedError ' ,
119
+ "No links containing text 'Next' and URL '/fsdfsdf/' were found in page /external_url " );
120
+ $ this ->module ->amOnPage ('/external_url ' );
121
+ $ this ->module ->seeLink ('Next ' , '/fsdfsdf/ ' );
122
+ }
123
+
124
+ public function testDontSeeLinkFailsIfTextMatches ()
125
+ {
126
+ $ this ->setExpectedException ('PHPUnit_Framework_AssertionFailedError ' ,
127
+ "Link containing text 'Next' was found in page /external_url " );
128
+ $ this ->module ->amOnPage ('/external_url ' );
129
+ $ this ->module ->dontSeeLink ('Next ' );
130
+ }
131
+
132
+ public function testDontSeeLinkFailsIfTextAndUrlMatches ()
133
+ {
134
+ $ this ->setExpectedException ('PHPUnit_Framework_AssertionFailedError ' ,
135
+ "Link containing text 'Next' and URL 'http://codeception.com/' was found in page /external_url " );
136
+ $ this ->module ->amOnPage ('/external_url ' );
137
+ $ this ->module ->dontSeeLink ('Next ' , 'http://codeception.com/ ' );
101
138
}
102
139
103
140
public function testClick ()
0 commit comments