Commit ccc39289 by Matjaz Gregoric Committed by E. Kolpakov

Update tests.

Most of the updates are related to the My Courses -> Studio Home change.
parent eabd6c8d
......@@ -171,7 +171,7 @@ def log_into_studio(
world.log_in(username=uname, password=password, email=email, name=name)
# Navigate to the studio dashboard
world.visit('/')
assert_in(uname, world.css_text('h2.title', timeout=10))
assert_in(uname, world.css_text('span.account-username', timeout=10))
def add_course_author(user, course):
......
......@@ -33,8 +33,8 @@ def i_create_a_course(step):
create_a_course()
@step('I click the course link in My Courses$')
def i_click_the_course_link_in_my_courses(step):
@step('I click the course link in Studio Home$')
def i_click_the_course_link_in_studio_home(step):
course_css = 'a.course-link'
world.css_click(course_css)
......@@ -52,8 +52,8 @@ def courseware_page_has_loaded_in_studio(step):
assert world.is_css_present(course_title_css)
@step('I see the course listed in My Courses$')
def i_see_the_course_in_my_courses(step):
@step('I see the course listed in Studio Home$')
def i_see_the_course_in_studio_home(step):
course_css = 'h3.class-title'
assert world.css_has_text(course_css, world.scenario_dict['COURSE'].display_name)
......
......@@ -11,7 +11,7 @@ Feature: CMS.Help
Scenario: Users can access online help within a course
Given I have opened a new course in Studio
And I click the course link in My Courses
And I click the course link in Studio Home
Then I should see online help for "outline"
And I go to the course updates page
......
......@@ -26,7 +26,7 @@ Feature: CMS.Sign in
And I visit the url "/signin?next=http://www.google.com/"
When I fill in and submit the signin form
And I wait for "2" seconds
Then I should see that the path is "/course/"
Then I should see that the path is "/home/"
Scenario: Login with mistyped credentials
Given I have opened a new course in Studio
......@@ -41,4 +41,4 @@ Feature: CMS.Sign in
Then I should not see a login error message
And I submit the signin form
And I wait for "2" seconds
Then I should see that the path is "/course/"
Then I should see that the path is "/home/"
......@@ -25,7 +25,7 @@ def i_press_the_button_on_the_registration_form(step):
@step('I should see an email verification prompt')
def i_should_see_an_email_verification_prompt(step):
world.css_has_text('h1.page-header', u'My Courses')
world.css_has_text('h1.page-header', u'Studio Home')
world.css_has_text('div.msg h3.title', u'We need to verify your email address')
......
......@@ -1166,11 +1166,10 @@ class ContentStoreTest(ContentStoreTestCase):
def test_course_index_view_with_no_courses(self):
"""Test viewing the index page with no courses"""
# Create a course so there is something to view
resp = self.client.get_html('/home/')
self.assertContains(
resp,
'<h1 class="page-header">My Courses</h1>',
'<h1 class="page-header">Studio Home</h1>',
status_code=200,
html=True
)
......
<div class="wrapper-mast wrapper">
<header class="mast has-actions">
<h1 class="page-header">My Courses</h1>
<h1 class="page-header">Studio Home</h1>
<nav class="nav-actions">
<h3 class="sr">Page Actions</h3>
<ul>
......@@ -21,13 +21,6 @@
<section class="content">
<article class="content-primary" role="main">
<div class="introduction">
<h2 class="title">Welcome, user!</h2>
<div class="copy">
<p>Here are all of the courses you currently have access to in Studio:</p>
</div>
</div>
<div class="wrapper-create-element wrapper-create-course">
<form class="form-create create-course course-info" id="create-course-form" name="create-course-form">
<div class="wrap-error">
......@@ -106,14 +99,14 @@
<li class="field text required" id="field-organization">
<label for="new-library-org">Organization</label>
<input class="new-library-org" id="new-library-org" type="text" name="new-library-org" aria-required="true" placeholder="e.g. UniversityX or OrganizationX" />
<span class="tip">The name of the organization sponsoring the library. <strong>Note: This is part of your library URL, so no spaces or special characters are allowed.</strong> This cannot be changed.</span>
<span class="tip">The public organization name for your library. This cannot be changed.</span>
<span class="tip tip-error is-hiding"></span>
</li>
<li class="field text required" id="field-library-number">
<label for="new-library-number">Library Code/Number</label>
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" placeholder="e.g. CSPROB" />
<span class="tip">The unique code that identifies this library. <strong>Note: This is part of your library URL, so no spaces or special characters are allowed and it cannot be changed.</strong></span>
<label for="new-library-number">Major Version Number</label>
<input class="new-library-number" id="new-library-number" type="text" name="new-library-number" aria-required="true" value="1" />
<span class="tip">The <strong>major version number</strong> of your library. Minor revisions are tracked as edits happen within a library.</span>
<span class="tip tip-error is-hiding"></span>
</li>
</ol>
......
......@@ -183,7 +183,7 @@
<div class="nav-sub">
<ul>
<li class="nav-item nav-account-dashboard">
<a href="/">${_("My Courses")}</a>
<a href="/">${_("Studio Home")}</a>
</li>
<li class="nav-item nav-account-signout">
<a class="action action-signout" href="${reverse('logout')}">${_("Sign Out")}</a>
......
......@@ -48,7 +48,7 @@ REQUIREJS_WAIT = {
"js/base", "js/models/course", "js/models/location", "js/models/section"],
# Dashboard
re.compile('^My Courses \|'): [
re.compile('^Studio Home \|'): [
"js/sock", "gettext", "js/base",
"jquery.ui", "coffee/src/main", "underscore"],
......
"""
My Courses page in Studio
Studio Home page
"""
from bok_choy.page_object import PageObject
......@@ -8,7 +8,7 @@ from . import BASE_URL
class DashboardPage(PageObject):
"""
My Courses page in Studio
Studio Home page
"""
url = BASE_URL + "/course/"
......@@ -28,13 +28,6 @@ class DashboardPage(PageObject):
def has_processing_courses(self):
return self.q(css='.courses-processing').present
@property
def page_subheader(self):
"""
Get the text of the introductory copy seen below the Welcome header. ("Here are all of...")
"""
return self.q(css='.content-primary .introduction .copy p').first.text[0]
def create_rerun(self, display_name):
"""
Clicks the create rerun link of the course specified by display_name.
......
......@@ -23,16 +23,6 @@ class CreateLibraryTest(WebAppTest):
self.auth_page = AutoAuthPage(self.browser, staff=True)
self.dashboard_page = DashboardPage(self.browser)
def test_subheader(self):
"""
From the home page:
Verify that subheader is correct
"""
self.auth_page.visit()
self.dashboard_page.visit()
self.assertIn("courses and libraries", self.dashboard_page.page_subheader)
def test_create_library(self):
"""
From the home page:
......
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