Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Commit

Permalink
[#829] normalize codecept test names (connects #829) (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
razu9861 authored and dogi committed Sep 12, 2017
1 parent 4c00dd5 commit a789d9e
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 47 deletions.
1 change: 1 addition & 0 deletions app/MyApp/app/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -5592,6 +5592,7 @@ $(function() {
model: collectionlist
})
inviteForm.render()
$('#invitationdiv').css({'height': '76%'})
$('#invitationdiv').html('&nbsp')
$('#invitationdiv').append(inviteForm.el)
App.Router.markdownEditor("description","collection","90")
Expand Down
2 changes: 1 addition & 1 deletion app/MyApp/app/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ textarea#question_text.surTextArea, textarea#answer_choices.surTextArea{
z-index: 2;
margin-left:10%;
overflow: scroll;
height: 70%;
height: 78%;
}
#popupDiv{
background-color: #B1B1B1;
Expand Down
1 change: 1 addition & 0 deletions app/MyApp/app/views/ListCollectionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $(function() {
}
},
hidediv: function() {
$('#invitationdiv').css({'height': '75%'})
$('#invitationdiv').fadeOut(1000)
document.getElementById('cont').style.opacity = 1.0
document.getElementById('nav').style.opacity = 1.0
Expand Down
4 changes: 2 additions & 2 deletions tests/becameAmember_test.js → tests/becomeMember_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Feature('BecameAmember');
Feature('BecomeMember');

Scenario('test BecomeAmember', (I) => {
Scenario('Test for Become a Member', (I) => {
var becMem = '//*[@id="formButton2"]';
var memForm = '//*[@id="memberform"]';
var regBtn = '//*[@id="formButton"]';
Expand Down
2 changes: 1 addition & 1 deletion tests/courses_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Before((I) => {
I.wait(10);
});

Scenario('Test For Course', (I, addquestion_po) => {
Scenario('Test for Course', (I, addquestion_po) => {
var courses = '//*[@href="#courses"]';
var addcourses = '//*[@id="addCourseButton"]';
var check = '//*[@value="Daily"]';
Expand Down
15 changes: 10 additions & 5 deletions tests/feedback_tset.js → tests/feedback_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@ Before((I) => {
I.wait(2);
});

Scenario('test feedback bug', (I, feedback_po) => {
Scenario('Test for Feedback Bug', (I, feedback_po) => {
feedback_po.open_feedback();
feedback_po.fill_feedback(0, "Bug", "This is a test bug report");
feedback_po.fill_feedback(0, "Bug", "This is a test question");
feedback_po.submit_feedback();
});

Scenario('test feedback question', (I, feedback_po) => {
Scenario('Test for Feedback Question', (I, feedback_po) => {
feedback_po.open_feedback();
feedback_po.fill_feedback(1, "Question", "This is a test question");
feedback_po.submit_feedback();
});

Scenario('test feedback suggestion', (I, feedback_po) => {
Scenario('Test for Feedback Suggestion', (I, feedback_po) => {
feedback_po.open_feedback();
feedback_po.fill_feedback(0, "Question", "This is a test suggestion");
feedback_po.submit_feedback();
});

Scenario('cancel feedback', (I, feedback_po) => {
Scenario('Test for Cancel Feedback', (I, feedback_po) => {
feedback_po.open_feedback();
feedback_po.close_feedback();
});

Scenario('Test for View Feedback', (I, feedback_po) => {
feedback_po.open_feedback();
feedback_po.view_feedback_list();
});
2 changes: 1 addition & 1 deletion tests/language_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var languages = [
{ lan: "Arabic", log: "دخول" },
{ lan: "Urdu", log: "لاگ ان" }
];
Scenario('test language selection', (I) => {
Scenario('Test for Language Selection', (I) => {
I.amOnPage('http://127.0.0.1:5981/apps/_design/bell/MyApp/index.html');
languages.forEach(function (item) {
I.waitForVisible('//*[@id="onLoginLanguage"]');
Expand Down
6 changes: 3 additions & 3 deletions tests/login_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="./steps.d.ts" />
Feature('Login');

Scenario('test bad login', function* (I) {
Scenario('Test for Bad Login', function* (I) {
//// Bad username
I.amOnPage('http://127.0.0.1:5981/apps/_design/bell/MyApp/index.html');
I.waitForVisible('//*[@name="login"]');
Expand All @@ -25,12 +25,12 @@ Scenario('test bad login', function* (I) {
I.seeInCurrentUrl('#dashboard');
});

Scenario('test successful login', (I) => {
Scenario('Test for Successful Login', (I) => {
I.login('admin', 'password');
I.seeInCurrentUrl('#dashboard');
});

Scenario('test second successful login', (I) => {
Scenario('Test Second Successful Login', (I) => {
I.login('admin', 'password');
I.seeInCurrentUrl('#dashboard');
});
16 changes: 8 additions & 8 deletions tests/meetup_tset.js → tests/meetup_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Before((I) => {
I.wait(2);
});

Scenario('test single day meetup', (I, meetup_po) => {
Scenario('Test for Single Day Meetup', (I, meetup_po) => {
// Pick some dates
let someDate = new Date();
someDate.setDate(someDate.getDate() + 1);
Expand All @@ -37,12 +37,12 @@ Scenario('test single day meetup', (I, meetup_po) => {
// Do the actual tests
meetup_po.go_to_meetups();
meetup_po.create_meetup();
meetup_po.fill_meetup_form("Test Single Day Meetup", "This is a single day meetup, automatically created by meetup_test.js",
meetup_po.fill_meetup_form("Test Single Day Meetup",
"none", sdate, edate, "8:00am", "11:00pm", 'E Learning', "Test location A");
meetup_po.invite_members(null, 'All');
});

Scenario('test multiday meetup', (I, meetup_po) => {
Scenario('Test for Multiday Meetup', (I, meetup_po) => {
// Pick some dates
let someDate = new Date();
someDate.setDate(someDate.getDate() + 7);
Expand All @@ -67,13 +67,13 @@ Scenario('test multiday meetup', (I, meetup_po) => {
// Do the actual tests
meetup_po.go_to_meetups();
meetup_po.create_meetup();
meetup_po.fill_meetup_form("Multiple Day Meetup", "This is a multiple day meetup, automatically created by meetup_test.js",
meetup_po.fill_meetup_form("Multiple Day Meetup",
"none", sdate, edate, "7:00am", "5:00pm", 'First Time', "Test location B");
meetup_po.invite_members(null, 'All');
});


Scenario('test recurring meetup', (I, meetup_po) => {
Scenario('Test for Recurring Meetup', (I, meetup_po) => {
// Pick some dates
let someDate = new Date();
someDate.setDate(someDate.getDate() + 60);
Expand All @@ -98,17 +98,17 @@ Scenario('test recurring meetup', (I, meetup_po) => {
// Do the actual tests
meetup_po.go_to_meetups();
meetup_po.create_meetup();
meetup_po.fill_meetup_form("Recurring Meetup", "This is a recurring meetup, automatically created by meetup_test.js",
meetup_po.fill_meetup_form("Recurring Meetup",
"Daily", sdate, edate, "9:00am", "2:00pm", 'First Time', "Test location C");
meetup_po.invite_members(null, 'All');
});
Scenario('test cancel meetup', (I, meetup_po) => {
Scenario('Test for Cancel Meetup', (I, meetup_po) => {
meetup_po.go_to_meetups();
meetup_po.create_meetup();
meetup_po.cancel_meetup();
});

Scenario('test delete meetup', (I, meetup_po) => {
Scenario('Test for Delete Meetup', (I, meetup_po) => {
meetup_po.go_to_meetups();
meetup_po.delete_meetup("Test Single Day Meetup");
meetup_po.delete_meetup("Multiple Day Meetup");
Expand Down
5 changes: 5 additions & 0 deletions tests/pages/feedback_po.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ module.exports = {
}
I.waitForVisible(typeLocator);
I.click(typeLocator);
var feedbackdesc = '//*[@id="feedback_description_link"]';
I.waitForVisible(feedbackdesc);
I.click(feedbackdesc);
I.fillField(this.feedbackText, text);

},
Expand All @@ -52,6 +55,8 @@ module.exports = {
view_feedback_list() {
I.click(this.feedbackList);
I.seeInCurrentUrl('#siteFeedback');
I.wait(2);
I.click("Feedback");
}

}
12 changes: 9 additions & 3 deletions tests/pages/meetup_po.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
meetupFormCancel: '//*[@id="MeetUpcancel"]',
form: '//*[@id="meetUpForm"]',
meetupTitle: '//*[@name="title"]',
meetupDesc: '//*[@name="description"]',
//meetupDesc: '//*[@class="redactor_editor"]',
meetupSdate: '//*[@name="startDate"]',
meetupEdate: '//*[@name="endDate"]',
meetupStime: '//*[@name="startTime"]',
Expand All @@ -42,6 +42,7 @@ module.exports = {
create_meetup() {
I.waitForVisible(this.addMeetupButton);
I.click(this.addMeetupButton);
I.wait(3)
I.waitForVisible(this.meetupSaveButton);
I.see("Start a New Meetup");
},
Expand All @@ -60,15 +61,20 @@ module.exports = {
I.dontSeeElement(deleteBTN);

},
fill_meetup_form(title, desc, recurringState, sdate, edate, stime, etime, catagory, location) {
fill_meetup_form(title, recurringState, sdate, edate, stime, etime, catagory, location) {
I.seeInCurrentUrl("#meetup/add");
I.waitForVisible(this.meetupSaveButton);
I.see("Start a New Meetup");

I.waitForVisible(this.form);

I.fillField(this.meetupTitle, title);
I.fillField(this.meetupDesc, desc);
I.executeScript(function() {
$('.redactor_ ').html('<b>This is a recurring meetup, automatically created by meetup_test.js</b>')
$('.bbf-editor [name="description"]').val('This is a recurring meetup, automatically created by meetup_test.js')

});
//I.fillField(this.meetupDesc, "This is a recurring meetup, automatically created by meetup_test.js");
I.fillField(this.meetupSdate, sdate);
I.fillField(this.meetupEdate, edate);
I.fillField(this.meetupStime, stime);
Expand Down
24 changes: 18 additions & 6 deletions tests/pages/resource_po.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
cancelResourceBtn: '//*[@id="cancel"]',
requestResourceBtn: '//*[@id="requestResource"]',
requestWindow: '//*[@id="site-request"]',
requestMessage: '//*[@name="request"]',
//requestMessage: '//*[@name="request"]',
requestSubmit: '//*[@id="formButton"]',
requestCancel: '//*[@id="CancelButton"]',
requestViewAll: '//*[@id="ViewAllButton"]',
Expand Down Expand Up @@ -69,6 +69,7 @@ module.exports = {
I.wait(7);
I.waitForVisible(this.libraryLink);
I.click(this.libraryLink);
I.wait(3)
I.waitForVisible(this.addResourceBtn);
I.see("Resources");
I.see("Collections ");
Expand All @@ -95,7 +96,10 @@ module.exports = {
I.waitForVisible(this.requestResourceBtn);
I.click(this.requestResourceBtn);
I.waitForVisible(this.requestWindow);
I.fillField(this.requestMessage, message);
I.executeScript(function() {
$('.redactor_ ').html("I want a certain test resource!")
});
//I.fillField(this.requestMessage, message);
if (doSubmit) {
I.click(this.requestSubmit);
I.wait(1);
Expand Down Expand Up @@ -213,13 +217,17 @@ module.exports = {
I.waitForVisible(this.addCollections);
},

add_collection(name, desc, parent) {
add_collection(name, parent) {
I.waitForVisible(this.addCollections);
I.wait(3);
I.click(this.addCollections);
I.waitForVisible(this.addCollectionWindow);
I.fillField(this.collectionName, name);
I.fillField(this.collectionDesc, desc);
// I.fillField(this.collectionDesc, desc);
I.executeScript(function() {
$('.redactor_ ').html("This is a test collection created by resource_test.js")
});
I.wait(3)
if (parent != null) {
I.selectOption(this.parentCollection, parent);
}
Expand Down Expand Up @@ -249,15 +257,19 @@ module.exports = {
I.seeInCurrentUrl('#collection');
},

edit_collection(name, newName, newDesc, newParent) {
edit_collection(name, newName, newParent) {
let editCollection = '//*[@id="collectionTable"]/tbody//*[text()="' + name + '"]/../../td/button';

I.waitForVisible(editCollection);
I.wait(7);
I.click(editCollection);
I.waitForVisible(this.addCollectionWindow);
I.fillField(this.collectionName, newName);
I.fillField(this.collectionDesc, newDesc);
// I.fillField(this.collectionDesc, newDesc);
I.executeScript(function() {
$('.redactor_ ').html("Should be gone", "Should be gone")
});
I.wait(3)
if (newParent) {
I.selectOption(this.parentCollection, newParent);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/publication_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Before((I) => {
I.wait(2);
});

Scenario('test add publications', (I, publication_po) => {
Scenario('Test for Add Publications', (I, publication_po) => {
publication_po.go_to_publications();
publication_po.create_publication("Test publication 1", "[email protected]", "1231075689");
publication_po.save_publication();
Expand All @@ -20,7 +20,7 @@ Scenario('test add publications', (I, publication_po) => {
publication_po.cancel_publication();
});

Scenario('test delete publication', (I, publication_po) => {
Scenario('Test for Delete Publication', (I, publication_po) => {
publication_po.go_to_publications();
publication_po.delete_publication("Test publication 2");
});
10 changes: 6 additions & 4 deletions tests/addReport_tset.js → tests/report_test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Feature('AddReport');
Feature('Report');
var today = new Date();
var dd = today.getDate();

Expand All @@ -10,7 +10,7 @@ Before((I) => {
I.login('admin', 'password');
I.wait(5);
});
Scenario('test AddReport', (I) => {
Scenario('Test for Add Report', (I) => {
let someDate = new Date();
someDate.setDate(someDate.getDate());
let dd1 = someDate.getDate();
Expand Down Expand Up @@ -88,7 +88,9 @@ Scenario('test AddReport', (I) => {
I.waitForVisible(comment);
I.waitForEnabled(comment);
I.click(comment);
I.fillField('comment', "This is a comment to Trend Report");
I.executeScript(function() {
$('.redactor_ ').html('<b>This is a comment to Trend Report</b>')
});
I.click(subBtn);
I.wait(2);
I.waitForVisible(clBtn);
Expand All @@ -110,7 +112,7 @@ Scenario('test AddReport', (I) => {


});
Scenario('test second DeleteReport', (I) => {
Scenario('Test for Delete Report', (I) => {
var navBar = '//*[@id="itemsinnavbar"]';
var report = '//*[@id="itemsinnavbar"]/li/a[@href="#reports"]';
var delet = '//*[@class="btn btn-danger destroy"]';
Expand Down
10 changes: 5 additions & 5 deletions tests/resource_tset.js → tests/resource_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before((I) => {
});


Scenario('test resources', (I, resource_po) => {
Scenario('Test for Resources', (I, resource_po) => {

let resource1 = {
title: "Test Resource 1",
Expand Down Expand Up @@ -41,14 +41,14 @@ Scenario('test resources', (I, resource_po) => {
resource_po.add_resource();
resource_po.fill_resource(resource1);
resource_po.save_resource();
resource_po.request_resource("I want a certain test resource!", true);
resource_po.request_resource();
resource_po.go_to_collections();
resource_po.add_collection("Test collection 1", "This is a test collection created by resource_test.js", null);
resource_po.add_collection("Test collection 1", null);
resource_po.submit_collection();
resource_po.add_collection("Test collection 2", "This is a test collection created by resource_test.js", null);
resource_po.add_collection("Test collection 2", null);
resource_po.submit_collection();
resource_po.merge_collections(["Test collection 1", "Test collection 2."], "Merged Test Collections");
resource_po.edit_collection("Test collection 1", "Should be gone", "Should be gone", null);
resource_po.edit_collection("Test collection 1", "Should be gone", null);
resource_po.delete_current_collection(false);
resource_po.go_to_resources();
resource_po.add_resource();
Expand Down
Loading

0 comments on commit a789d9e

Please sign in to comment.