Skip to content

Commit

Permalink
#3368: Add anet object forms display test for no custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cemalettin-work committed Dec 21, 2020
1 parent 03668ad commit 7f3ada3
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 5 deletions.
49 changes: 49 additions & 0 deletions client/tests/webdriver/noCustomFieldsSpecs/anetObjectForms.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// import { expect } from "chai"
import CreateAuthorizationGroup from "../pages/createAuthorizationGroup.page"
import CreatePerson from "../pages/createNewPerson.page"
import CreateTask from "../pages/createNewTask.page"
import CreateOrganization from "../pages/CreateOrganization.page"
import CreateReport from "../pages/createReport.page"
import EditPosition from "../pages/editPosition.page"
import CreateNewLocation from "../pages/location/createNewLocation.page"

// Forms should work just fine without custom fields

describe("When looking at anet object forms with dictionary that doesn't include custom fields", () => {
it("Should see that report form successfully loads", () => {
CreateReport.open()
CreateReport.form.waitForExist()
CreateReport.form.waitForDisplayed()
})
it("Should see that person form successfully loads", () => {
CreatePerson.openAsSuperUser()
CreatePerson.form.waitForExist()
CreatePerson.form.waitForDisplayed()
})
it("Should see that task form successfully loads", () => {
CreateTask.openAsAdmin()
CreateTask.form.waitForExist()
CreateTask.form.waitForDisplayed()
})
it("Should see that authorization groups form successfully loads", () => {
CreateAuthorizationGroup.open()
CreateAuthorizationGroup.form.waitForExist()
CreateAuthorizationGroup.form.waitForDisplayed()
})
it("Should see that location form successfully loads", () => {
CreateNewLocation.open()
CreateNewLocation.createButton.click()
CreateNewLocation.nameRequiredError.waitForExist()
CreateNewLocation.nameRequiredError.waitForDisplayed()
})
it("Should see that position form successfully loads", () => {
EditPosition.open()
EditPosition.form.waitForExist()
EditPosition.form.waitForDisplayed()
})
it("Should see that organization form successfully loads", () => {
CreateOrganization.open()
CreateOrganization.form.waitForExist()
CreateOrganization.form.waitForDisplayed()
})
})
5 changes: 0 additions & 5 deletions client/tests/webdriver/noCustomFieldsSpecs/basicMaths.spec.js

This file was deleted.

34 changes: 34 additions & 0 deletions client/tests/webdriver/pages/createNewOrganization.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Page from "./page"

const PAGE_URL = "/organizations/new"

class CreateOrganization extends Page {
get form() {
return browser.$("form.form-horizontal")
}

get alertSuccess() {
return browser.$(".alert-success")
}

openAsSuperUser() {
super.openAsSuperUser(PAGE_URL)
}

openAsAdmin() {
super.openAsAdminUser(PAGE_URL)
}

waitForAlertSuccessToLoad() {
if (!this.alertSuccess.isDisplayed()) {
this.alertSuccess.waitForExist()
this.alertSuccess.waitForDisplayed()
}
}

submitForm() {
this.submitButton.click()
}
}

export default new CreateOrganization()

0 comments on commit 7f3ada3

Please sign in to comment.