1
1
module . exports = {
2
2
3
- 'Check if the main p tag with the class license-text is present' : function ( browser ) {
3
+ 'Check if the p- tag with the class license-text is present' : function ( browser ) {
4
4
browser
5
5
. init ( )
6
6
. assert . elementPresent ( '.control-label > span' )
@@ -14,11 +14,28 @@ module.exports = {
14
14
. click ( '.pagination-next' )
15
15
. assert . elementPresent ( 'p[class="license-text"]' )
16
16
} ,
17
- 'Check if the a tag in the "Rich Text" redirects to https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser ' : function ( browser ) {
17
+ 'Check if the links in the license code redirects properly ' : function ( browser ) {
18
18
browser
19
+ . setValue ( 'input[placeholder="Jane Doe"]' , 'Jane Doe' )
20
+ . setValue ( 'input[placeholder="www.author.com"]' , 'www.author.com' )
21
+ . setValue ( 'input[placeholder="This work"]' , 'This work' )
22
+ . setValue ( 'input[placeholder="www.author.com/work.jpg"]' , 'www.author.com/work.jpg' )
19
23
. assert . elementPresent ( 'p[class="license-text"] a' )
20
- . getAttribute ( 'p[class="license-text"] a' , 'href' , function ( result ) {
24
+ . getAttribute ( 'p > span > a:nth-child(1)' , 'href' , function ( result ) {
25
+ this . assert . equal ( result . value , 'http://localhost:8080/www.author.com/work.jpg' )
26
+ } )
27
+ . getAttribute ( 'p > span > a:nth-child(2)' , 'href' , function ( result ) {
28
+ this . assert . equal ( result . value , 'http://localhost:8080/www.author.com' )
29
+ } )
30
+ . getAttribute ( 'p > span > a:nth-child(4)' , 'href' , function ( result ) {
21
31
this . assert . equal ( result . value , 'https://creativecommons.org/licenses/by-sa/4.0/?ref=ccchooser' )
22
32
} )
33
+ } ,
34
+ 'Check if the text is displayed under the print attribution' : function ( browser ) {
35
+ browser
36
+ . click ( 'nav > ul > li:nth-child(2) > a' )
37
+ . assert . elementPresent ( 'p[class="license-text"]' )
38
+ . assert . elementPresent ( '#attribution-text > p > span:nth-child(1)' )
39
+ . assert . elementPresent ( '#attribution-text > p > span:nth-child(2)' )
23
40
}
24
41
}
0 commit comments