public function testCantCreateModuleWithoutSchool() { do_admin_login($this); $this->open("/admin/list_modules.php"); $this->click("link=Create new Module"); $this->waitForPageToLoad("30000"); $this->type("name=modulecode", "S01SNE"); $this->type("name=fullname", "Should Not Exist"); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_module.php"); }
public function testCantCreateSchoolWithoutName() { do_admin_login($this); $this->open("/admin/list_schools.php"); $this->click("link=Create new School"); $this->waitForPageToLoad("30000"); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_school.php"); $this->type("id=school", ""); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_school.php"); }
public function testCantCreateFacultyWithoutName() { do_admin_login($this); $this->open("/admin/list_faculties.php"); $this->click("link=Create new Faculty"); $this->waitForPopUp("faculties", "30000"); $this->selectWindow("name=faculties"); $this->click("name=ok"); $this->selectWindow('null'); $this->open("/admin/list_faculties.php"); $this->waitForPageToLoad("30000"); $this->assertCssCount('css=tr.l', 3); }
public function testAddQuestionsByPaperMissingParams() { do_admin_login($this); // Check date in denied log to within an hour - very slim chance of this generating a false failure // Also, ensure that your php.ini for CLI contains the same timezone setting as the web php.ini $now = date('d/m/Y H'); $this->open("question/add/add_questions_by_paper.php?question_paper="); $this->assertTextPresent('A mandatory GET variable is missing'); // Check the denied log $this->open("admin/view_access_denied.php"); $this->assertElementContainsText('css=#denied1 td:nth-child(2)', $now); $this->assertElementContainsText('css=#denied1 td:nth-child(3)', 'Mr S Testing'); $this->assertElementContainsText('css=#denied1 td:nth-child(4)', '/question/add/add_questions_by_paper.php?question_paper='); $this->assertElementContainsText('css=#denied1 td:nth-child(5)', 'A mandatory GET variable is missing.'); }
public function testCantCreateCourseWithoutRequiredFields() { do_admin_login($this); $this->open("/admin/list_courses.php"); $this->click("link=Create new Course"); $this->waitForPageToLoad("30000"); $this->type("name=description", "Test Course"); $this->select("name=school", "label=School of Selenium Testing"); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_course.php"); $this->type("name=course", "S200"); $this->type("name=description", ""); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_course.php"); $this->type("name=description", "Test Course"); $this->select("name=school", "label="); $this->click("name=submit"); $this->assertLocation($this->page_root . "/admin/add_course.php"); }
/** * @depends testAddUserToTeam */ public function testUserAppearsInTeamList() { do_admin_login($this); $this->open("/staff/"); $this->click("css=strong"); $this->waitForPageToLoad("30000"); $this->click("link=School of Selenium Testing"); $this->click("link=exact:S01SET: Selenium Testing"); $this->waitForPageToLoad("30000"); $this->assertElementContainsText("//div[8]/form/div/ul/li[2]/a", 'Staff2, T. Mr'); }
public function testUploadMarksNonExistentPaper() { do_admin_login($this); $this->open("import/offline_marks.php?paperID=88888888888&module=3&folder="); $this->assertTextPresent('Page not Found'); }
public function testCantCreateDuplicateStatus() { do_admin_login($this); $this->open("/admin/list_statuses.php"); $this->waitForPageToLoad("30000"); $this->click("link=Create new Status"); $this->waitForPageToLoad("30000"); $this->assertTitle('Add Status' . $this->install_type); $this->type('id=name', 'Normal'); $this->click('name=submit'); $this->waitForPageToLoad('30000'); $this->assertTextPresent('Status names must be unique'); $this->assertLocation($this->page_root . '/admin/edit_status.php'); }