Commit b6c00810 by Diana Huang

Look for the existence of the links, not for

the actual urls
parent 22cf0dfa
...@@ -122,6 +122,13 @@ def should_see_a_link_called(step, text): ...@@ -122,6 +122,13 @@ def should_see_a_link_called(step, text):
assert len(world.browser.find_link_by_text(text)) > 0 assert len(world.browser.find_link_by_text(text)) > 0
@step(r'should see (?:the|a) link with the id "([^"]*)" called "([^"]*)"$')
def should_have_link_with_id_and_text(step, link_id, text):
link = world.browser.find_by_id(link_id)
assert len(link) > 0
assert_equals(link.text, text)
@step(r'should see "(.*)" (?:somewhere|anywhere) in (?:the|this) page') @step(r'should see "(.*)" (?:somewhere|anywhere) in (?:the|this) page')
def should_see_in_the_page(step, text): def should_see_in_the_page(step, text):
assert_in(text, world.css_text('body')) assert_in(text, world.css_text('body'))
......
...@@ -5,29 +5,24 @@ Feature: Homepage for web users ...@@ -5,29 +5,24 @@ Feature: Homepage for web users
Scenario: User can see the "Login" button Scenario: User can see the "Login" button
Given I visit the homepage Given I visit the homepage
Then I should see a link called "Log In" Then I should see a link called "Log in"
Scenario: User can see the "Sign up" button Scenario: User can see the "Register Now" button
Given I visit the homepage Given I visit the homepage
Then I should see a link called "Sign Up" Then I should see a link called "Register Now"
Scenario Outline: User can see main parts of the page Scenario Outline: User can see main parts of the page
Given I visit the homepage Given I visit the homepage
Then I should see a link called "<Link>" Then I should see a link with the id "<id>" called "<Link>"
When I click the link with the text "<Link>"
Then I should see that the path is "<Path>"
Examples: Examples:
| Link | Path | | id | Link |
| Find Courses | /courses | | about | About |
| About | /about | | jobs | Jobs |
| Jobs | /jobs | | faq | FAQ |
| Contact | /contact | | contact | Contact|
| press | Press |
Scenario: User can visit the blog
Given I visit the homepage
When I click the link with the text "Blog"
Then I should see that the url is "http://blog.edx.org/"
# TODO: test according to domain or policy # TODO: test according to domain or policy
Scenario: User can see the partner institutions Scenario: User can see the partner institutions
......
...@@ -8,27 +8,27 @@ ...@@ -8,27 +8,27 @@
<nav class="nav-colophon"> <nav class="nav-colophon">
<ol> <ol>
<li class="nav-colophon-01"> <li class="nav-colophon-01">
<a href="${marketing_link('ABOUT')}"> <a id="about" href="${marketing_link('ABOUT')}">
About About
</a> </a>
</li> </li>
<li class="nav-colophon-02"> <li class="nav-colophon-02">
<a href="${marketing_link('JOBS')}"> <a id="jobs" href="${marketing_link('JOBS')}">
Jobs Jobs
</a> </a>
</li> </li>
<li class="nav-colophon-03"> <li class="nav-colophon-03">
<a href="${marketing_link('PRESS')}"> <a id="press" href="${marketing_link('PRESS')}">
Press Press
</a> </a>
</li> </li>
<li class="nav-colophon-04"> <li class="nav-colophon-04">
<a href="${marketing_link('FAQ')}"> <a id="faq" href="${marketing_link('FAQ')}">
FAQ FAQ
</a> </a>
</li> </li>
<li class="nav-colophon-05"> <li class="nav-colophon-05">
<a href="${marketing_link('CONTACT')}"> <a id="contact" href="${marketing_link('CONTACT')}">
Contact Contact
</a> </a>
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment