SEC-2915: groovy/gradle spaces->tabs

This commit is contained in:
Rob Winch
2015-03-23 11:14:26 -05:00
parent cf9f58a4ac
commit 0a2e496a84
121 changed files with 6033 additions and 6033 deletions

View File

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,62 +26,62 @@ import org.springframework.security.samples.pages.*
*/
@Stepwise
class ContactsTests extends GebReportingSpec {
def 'access home page with unauthenticated user success'() {
when: 'Unauthenticated user accesses the Home Page'
to HomePage
then: 'The page is displayed'
at HomePage
}
def 'access home page with unauthenticated user success'() {
when: 'Unauthenticated user accesses the Home Page'
to HomePage
then: 'The page is displayed'
at HomePage
}
def 'access manage page with unauthenticated user sends to login page'() {
when: 'Unauthenticated user accesses the Manage Page'
manage.click(LoginPage)
then: 'The login page is displayed'
at LoginPage
}
def 'access manage page with unauthenticated user sends to login page'() {
when: 'Unauthenticated user accesses the Manage Page'
manage.click(LoginPage)
then: 'The login page is displayed'
at LoginPage
}
def 'authenticated user is sent to original page'() {
when: 'user authenticates'
login()
then: 'The manage page is displayed'
at ContactsPage
}
def 'authenticated user is sent to original page'() {
when: 'user authenticates'
login()
then: 'The manage page is displayed'
at ContactsPage
}
def 'add contact link works'() {
when: 'user clicks add link'
addContact.click(AddPage)
then: 'The add page is displayed'
at AddPage
}
def 'add contact link works'() {
when: 'user clicks add link'
addContact.click(AddPage)
then: 'The add page is displayed'
at AddPage
}
def 'add contact'() {
when: 'add a contact'
addContact
then: 'The add page is displayed'
at ContactsPage
and: 'The new contact is displayed'
contacts.find { it.email == 'rob@example.com' }?.name == 'Rob Winch'
}
def 'add contact'() {
when: 'add a contact'
addContact
then: 'The add page is displayed'
at ContactsPage
and: 'The new contact is displayed'
contacts.find { it.email == 'rob@example.com' }?.name == 'Rob Winch'
}
def 'delete contact'() {
when: 'delete a contact'
contacts.find { it.email == 'rob@example.com' }.delete()
then: 'Delete confirmation displayed'
at DeleteConfirmPage
when: 'View Manage Page'
manage.click()
then: 'New contact has been removed'
!contacts.find { it.email == 'rob@example.com' }
}
def 'delete contact'() {
when: 'delete a contact'
contacts.find { it.email == 'rob@example.com' }.delete()
then: 'Delete confirmation displayed'
at DeleteConfirmPage
when: 'View Manage Page'
manage.click()
then: 'New contact has been removed'
!contacts.find { it.email == 'rob@example.com' }
}
def 'authenticated user logs out'() {
when: 'user logs out'
logout.click()
then: 'the default logout success page is displayed'
at HomePage
when: 'Unauthenticated user accesses the Manage Page'
via ContactsPage
then: 'The login page is displayed'
at LoginPage
}
def 'authenticated user logs out'() {
when: 'user logs out'
logout.click()
then: 'the default logout success page is displayed'
at HomePage
when: 'Unauthenticated user accesses the Manage Page'
via ContactsPage
then: 'The login page is displayed'
at LoginPage
}
}

View File

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,15 +23,15 @@ import geb.Page
* @author Rob Winch
*/
class AddPage extends Page {
static url = 'add'
static at = { assert driver.title == 'Add New Contact'; true}
static content = {
addContact(required:false) { name = 'Rob Winch', email = 'rob@example.com'->
addForm.name = name
addForm.email = email
submit.click()
}
addForm { $('form') }
submit { $('input', type: 'submit') }
}
static url = 'add'
static at = { assert driver.title == 'Add New Contact'; true}
static content = {
addContact(required:false) { name = 'Rob Winch', email = 'rob@example.com'->
addForm.name = name
addForm.email = email
submit.click()
}
addForm { $('form') }
submit { $('input', type: 'submit') }
}
}

View File

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,11 +23,11 @@ import geb.*
* @author Rob Winch
*/
class HomePage extends Page {
static url = ''
static at = { assert driver.title == 'Contacts Security Demo'; true}
static content = {
manage(to: [ContactsPage,LoginPage]) { $('a', text: 'Manage') }
debug { $('a', text: 'Debug').click() }
frames { $('a', text: 'Frames').click() }
}
static url = ''
static at = { assert driver.title == 'Contacts Security Demo'; true}
static content = {
manage(to: [ContactsPage,LoginPage]) { $('a', text: 'Manage') }
debug { $('a', text: 'Debug').click() }
frames { $('a', text: 'Frames').click() }
}
}

View File

@@ -5,7 +5,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -23,15 +23,15 @@ import geb.*
* @author Rob Winch
*/
class LoginPage extends Page {
static url = 'login'
static at = { assert driver.title == 'Login'; true}
static content = {
login(required:false) { user='rod', password='koala' ->
loginForm.username = user
loginForm.password = password
submit.click()
}
loginForm { $('form') }
submit { $('input', type: 'submit') }
}
static url = 'login'
static at = { assert driver.title == 'Login'; true}
static content = {
login(required:false) { user='rod', password='koala' ->
loginForm.username = user
loginForm.password = password
submit.click()
}
loginForm { $('form') }
submit { $('input', type: 'submit') }
}
}