Skip to content

Commit

Permalink
minor fixes(#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayshukla30 committed May 4, 2018
1 parent 00071bb commit b8059a3
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DataModelPolicyListPage extends Page {
static content = {
createLink { $('#role_list_create-catalogue-element-menu-item-link', 0) }
dataModelPolicyLinks { $('a', href: contains("#/catalogue/dataModelPolicy/")) }
nav { $('#topmenu', 0) .module(NavModule) }
nav { $('div.navbar-collapse', 0).module(NavModuleAdmin) }
}

int countDataModelPolicyLinks() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.modelcatalogue.core.geb

import geb.Module

class NavModuleAdmin extends Module {

static content = {
newRealtionshipButton { $('#role_list_create-catalogue-element-menu-item-link') }
searchButton { $('#role_navigation-right_search-menu-menu-item-link') }
createDataModelButton { $('#role_navigation-right_create-data-model-menu-item-link') }
curatorMenuDropdownLink { $('#role_navigation-right_curator-menu-menu-item-link') }
importExcel { $('#import-excel-menu-item-link') }
importOBO { $('#import-obo-menu-item-link') }
importDSL { $('#import-dsl-menu-item-link') }
importXML { $('#import-xml-menu-item-link') }
adminMenuDropdownLink { $('#role_navigation-right_admin-menu-menu-item-link') }
usersLink { $('#user-super-admin-menu-item-link') }
dataModelPermissionLink { $('#datamodelpermission-admin-menu-item-link') }
codeVersionLink { $('#code-version-menu-item-link') }
mappingUtilityLink { $('#action-batches-menu-item-link') }
activityLink { $('#user-last-seen-menu-item-link') }
reindexCatalogueLink { $('#reindex-catalogue-menu-item-link') }
relationshipTypesLink { $('#relationship-types-menu-item-link') }
dataModelPolicyLink { $('#data-model-policies-menu-item-link') }
monitoringLink { $('#monitoring-menu-item-link') }
logsLink { $('#logs-archive-menu-item-link') }
feedbackLink { $('#feedbacks-menu-item') }
userMenuDropdownLink { $('#role_navigation-right_user-menu-menu-item-link') }
userInfoLink { $('#user-info-menu-item-link') }
favouritesLink { $('#user-favorites-menu-item') }
apiKeyLink { $('#user-api-key-menu-item-link') }
logoutLink { $('#user-login-right-menu-item-link') }
}


void adminMenu() {
adminMenuDropdownLink.click()
}

void dataModelPolicies() {
dataModelPolicyLink.click()
}

void monitoring() {
monitoringLink.click()
}

void logs() {
logsLink.click()
}

void feedbacks() {
feedbackLink.click()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class RelationshipTypesPage extends Page {
static at = { title == 'Relationship Types' }

static content = {
nav { $('#topmenu', 0).module(NavModule) }
nav { $('div.navbar-collapse', 0).module(NavModuleAdmin) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class VerifySupervisorCanActionSettingsSpec extends GebSpec {
def "navigate to datamodelpolicy"() {
when:
RelationshipTypesPage relationshipTypesPage = browser.page RelationshipTypesPage
relationshipTypesPage.nav.cogMenu()
relationshipTypesPage.nav.adminMenu()
then:
at RelationshipTypesPage //this page nav is with different name
at RelationshipTypesPage

when:
relationshipTypesPage = browser.page RelationshipTypesPage
Expand All @@ -146,43 +146,50 @@ class VerifySupervisorCanActionSettingsSpec extends GebSpec {
def "navigate to monitoring"() {
when:
DataModelPolicyListPage dataModelPolicyListPage = browser.page DataModelPolicyListPage
dataModelPolicyListPage.nav.cogMenu()
dataModelPolicyListPage.nav.adminMenu()
then:
at DataModelPolicyListPage

when:
dataModelPolicyListPage = browser.page DataModelPolicyListPage
String winHandleBefore = driver.getWindowHandle();
dataModelPolicyListPage.nav.monitoring()
for (String winHandle : driver.getWindowHandles()) {
driver.switchTo().window(winHandle)
}
driver.close()
driver.switchTo().window(winHandleBefore);
then:
true
//new browser window should open
at DataModelPolicyListPage
}

def "navigate to logs"() {
when:
DataModelPolicyListPage dataModelPolicyListPage = browser.page DataModelPolicyListPage
dataModelPolicyListPage.nav.cogMenu()
dataModelPolicyListPage.nav.adminMenu()
then:
at DataModelPolicyListPage

when:
dataModelPolicyListPage = browser.page DataModelPolicyListPage
dataModelPolicyListPage.nav.logs()
for (String winHandle : driver.getWindowHandles()) {
driver.switchTo().window(winHandle)
}
then:
at LogsPage
//new browser window should open
}

def "navigate to feedback"() {
when:
DataModelPolicyListPage dataModelPolicyListPage = browser.page DataModelPolicyListPage
dataModelPolicyListPage.nav.cogMenu()
LogsPage logsPage = browser.page LogsPage
logsPage.nav.cogMenu()
then:
at DataModelPolicyListPage
at LogsPage

when:
dataModelPolicyListPage = browser.page DataModelPolicyListPage
dataModelPolicyListPage.nav.feedbacks()
logsPage = browser.page LogsPage
logsPage.nav.feedbacks()
then:
at FeedbackPage
}
Expand Down

0 comments on commit b8059a3

Please sign in to comment.