2020-07-15 01:29:15 +02:00
|
|
|
var common = require("../casper_lib/common.js");
|
2020-04-10 12:48:09 +02:00
|
|
|
|
|
|
|
common.start_and_log_in();
|
|
|
|
|
|
|
|
common.manage_organization();
|
|
|
|
|
|
|
|
// Test custom profile fields
|
|
|
|
casper.test.info("Testing custom profile fields");
|
|
|
|
casper.thenClick("li[data-section='profile-field-settings']");
|
|
|
|
casper.then(function () {
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitUntilVisible(".admin-profile-field-form", function () {
|
|
|
|
casper.fill("form.admin-profile-field-form", {
|
|
|
|
name: "Teams",
|
|
|
|
field_type: "1",
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
|
|
|
casper.click("form.admin-profile-field-form button[type='submit']");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function () {
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitUntilVisible("#admin-add-profile-field-status img", function () {
|
|
|
|
casper.test.assertSelectorHasText("div#admin-add-profile-field-status", "Saved");
|
|
|
|
common.wait_for_text(".profile-field-row span.profile_field_name", "Teams", function () {
|
2020-07-15 00:34:28 +02:00
|
|
|
casper.test.assertSelectorHasText(
|
|
|
|
".profile-field-row span.profile_field_name",
|
|
|
|
"Teams"
|
|
|
|
);
|
|
|
|
casper.test.assertSelectorHasText(
|
|
|
|
".profile-field-row span.profile_field_type",
|
|
|
|
"Short text"
|
|
|
|
);
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.click(".profile-field-row button.open-edit-form");
|
2020-04-10 13:24:37 +02:00
|
|
|
});
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function () {
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitUntilVisible("tr.profile-field-form form", function () {
|
|
|
|
casper.fill("tr.profile-field-form form.name-setting", {
|
|
|
|
name: "team",
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.click("tr.profile-field-form button.submit");
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function () {
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitUntilVisible("#admin-profile-field-status img", function () {
|
|
|
|
casper.test.assertSelectorHasText("div#admin-profile-field-status", "Saved");
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitForSelectorTextChange(".profile-field-row span.profile_field_name", function () {
|
|
|
|
casper.test.assertSelectorHasText(".profile-field-row span.profile_field_name", "team");
|
2020-07-15 00:34:28 +02:00
|
|
|
casper.test.assertSelectorHasText(
|
|
|
|
".profile-field-row span.profile_field_type",
|
|
|
|
"Short text"
|
|
|
|
);
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.click(".profile-field-row button.delete");
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
casper.then(function () {
|
2020-07-15 01:29:15 +02:00
|
|
|
casper.waitUntilVisible("#admin-profile-field-status img", function () {
|
|
|
|
casper.test.assertSelectorHasText("div#admin-profile-field-status", "Saved");
|
2020-04-10 12:48:09 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
common.then_log_out();
|
|
|
|
|
|
|
|
casper.run(function () {
|
|
|
|
casper.test.done();
|
|
|
|
});
|