mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 15:25:57 +00:00
feat(e2e): group create feature (#8636)
Co-authored-by: mahula <lenzmath@posteo.de>
This commit is contained in:
parent
aaf3b34125
commit
b67c9fd7cb
27
cypress/e2e/Group.Create.feature
Normal file
27
cypress/e2e/Group.Create.feature
Normal file
@ -0,0 +1,27 @@
|
||||
Feature: Create a group
|
||||
As an logged in user
|
||||
I would like to create a group
|
||||
To invite my friends
|
||||
|
||||
Background:
|
||||
Given the following "users" are in the database:
|
||||
| slug | email | password | id | name | termsAndConditionsAgreedVersion |
|
||||
| narrator | narrator@example.org | 1234 | narrator | Nathan Narrator | 0.0.4 |
|
||||
And I am logged in as "narrator"
|
||||
And I navigate to page "/groups"
|
||||
|
||||
Scenario: Create a group
|
||||
When I click on "create group button"
|
||||
Then I am on page "groups/create"
|
||||
When I choose "My group " as the name
|
||||
And I choose "public" as the visibility
|
||||
And I choose "to invite my friends" as the about
|
||||
And I choose the following text as description:
|
||||
"""
|
||||
This is the group where I want to exchange
|
||||
my views with my friends.
|
||||
"""
|
||||
And I choose "regional" as the action radius
|
||||
And I click on "save button"
|
||||
Then I am on page "/groups/.*/my-group"
|
||||
And the group was saved successfully
|
||||
@ -0,0 +1,9 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I choose the following text as description:', text => {
|
||||
cy.task('getValue', 'lastGroup').then(lastGroup => {
|
||||
lastGroup.description = text.replace('\n', ' ')
|
||||
cy.task('pushValue', { name: 'lastGroup', value: lastGroup })
|
||||
cy.get('.editor .ProseMirror').type(lastGroup.description)
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,9 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I choose {string} as the about', about => {
|
||||
cy.task('getValue', 'lastGroup').then(lastGroup => {
|
||||
lastGroup.about = about.replace('\n', ' ')
|
||||
cy.task('pushValue', { name: 'lastGroup', value: lastGroup })
|
||||
cy.get('input[name="about"]').type(lastGroup.about)
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,9 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I choose {string} as the action radius', actionRadius => {
|
||||
cy.task('getValue', 'lastGroup').then(lastGroup => {
|
||||
lastGroup.actionRadius = actionRadius.replace('\n', ' ')
|
||||
cy.task('pushValue', { name: 'lastGroup', value: lastGroup })
|
||||
cy.get('select[name="actionRadius"]').select(lastGroup.actionRadius)
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,8 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I choose {string} as the name', name => {
|
||||
const lastGroup = {}
|
||||
lastGroup.name = name.replace('\n', ' ')
|
||||
cy.task('pushValue', { name: 'lastGroup', value: lastGroup })
|
||||
cy.get('input[name="name"]').type(lastGroup.name)
|
||||
})
|
||||
@ -0,0 +1,9 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('I choose {string} as the visibility', groupType => {
|
||||
cy.task('getValue', 'lastGroup').then(lastGroup => {
|
||||
lastGroup.groupType = groupType.replace('\n', ' ')
|
||||
cy.task('pushValue', { name: 'lastGroup', value: lastGroup })
|
||||
cy.get('select[name="groupType"]').select(lastGroup.groupType)
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,7 @@
|
||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||
|
||||
defineStep('the group was saved successfully', () => {
|
||||
cy.task('getValue', 'lastGroup').then(lastGroup => {
|
||||
cy.get('h3.ds-heading').should('contain', lastGroup.name)
|
||||
})
|
||||
})
|
||||
@ -4,6 +4,7 @@ defineStep('I click on {string}', element => {
|
||||
const elementSelectors = {
|
||||
'submit button': 'button[name=submit]',
|
||||
'create post button': '.post-add-button',
|
||||
'create group button': '.group-add-button',
|
||||
'save button': 'button[type=submit]',
|
||||
'the first post': '.post-teaser:first-child',
|
||||
'comment button': 'button[type=submit]',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user