mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
UserProfile.SocialMedia.feature
This commit is contained in:
parent
7a06c0c5ed
commit
00101a7c60
41
cypress/integration/UserProfile.SocialMedia.feature
Normal file
41
cypress/integration/UserProfile.SocialMedia.feature
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
Feature: List Social Media Accounts
|
||||||
|
As a User
|
||||||
|
I'd like to enter my social media
|
||||||
|
So I can show them to other users to get in contact
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given the following "users" are in the database:
|
||||||
|
| email | password | id | name | slug | termsAndConditionsAgreedVersion |
|
||||||
|
| peterpan@example.org | 123 | id-of-peter-pan | Peter Pan | peter-pan | 0.0.4 |
|
||||||
|
And I am logged in as "peter-pan"
|
||||||
|
|
||||||
|
Scenario: Adding Social Media
|
||||||
|
When I navigate to page "/settings/my-social-media"
|
||||||
|
Then I am on page "/settings/my-social-media"
|
||||||
|
When I add a social media link
|
||||||
|
Then I see a toaster with "Added social media"
|
||||||
|
And the new social media link shows up on the page
|
||||||
|
|
||||||
|
Scenario: Other users viewing my Social Media
|
||||||
|
Given I have added a social media link
|
||||||
|
When I navigate to page "/profile/peter-pan"
|
||||||
|
Then they should be able to see my social media links
|
||||||
|
|
||||||
|
Scenario: Deleting Social Media
|
||||||
|
When I navigate to page "/settings/my-social-media"
|
||||||
|
Then I am on page "/settings/my-social-media"
|
||||||
|
Given I have added a social media link
|
||||||
|
When I delete a social media link
|
||||||
|
Then I see a toaster with "Deleted social media"
|
||||||
|
|
||||||
|
Scenario: Editing Social Media
|
||||||
|
When I navigate to page "/settings/my-social-media"
|
||||||
|
Then I am on page "/settings/my-social-media"
|
||||||
|
Given I have added a social media link
|
||||||
|
When I start editing a social media link
|
||||||
|
Then I can cancel editing
|
||||||
|
When I start editing a social media link
|
||||||
|
And I edit and save the link
|
||||||
|
Then I see a toaster with "Added social media"
|
||||||
|
And the new url is displayed
|
||||||
|
But the old url is not displayed
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import { When } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
When('I add a social media link', () => {
|
||||||
|
cy.get('input#addSocialMedia')
|
||||||
|
.type('https://freeradical.zone/peter-pan')
|
||||||
|
.get('button')
|
||||||
|
.contains('Add link')
|
||||||
|
.click()
|
||||||
|
})
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Then('I can cancel editing', () => {
|
||||||
|
cy.get('button#cancel')
|
||||||
|
.click()
|
||||||
|
.get('input#editSocialMedia')
|
||||||
|
.should('have.length', 0)
|
||||||
|
})
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { When } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
When('I delete a social media link', () => {
|
||||||
|
cy.get(".base-button[title='Delete']")
|
||||||
|
.click()
|
||||||
|
})
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import { When } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
When('I edit and save the link', () => {
|
||||||
|
cy.get('input#editSocialMedia')
|
||||||
|
.clear()
|
||||||
|
.type('https://freeradical.zone/tinkerbell')
|
||||||
|
.get('button')
|
||||||
|
.contains('Save')
|
||||||
|
.click()
|
||||||
|
})
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import { Given } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Given('I have added a social media link', () => {
|
||||||
|
cy.visit('/settings/my-social-media')
|
||||||
|
.get('input#addSocialMedia')
|
||||||
|
.type('https://freeradical.zone/peter-pan')
|
||||||
|
.get('button')
|
||||||
|
.contains('Add link')
|
||||||
|
.click()
|
||||||
|
})
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { When } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
When('I start editing a social media link', () => {
|
||||||
|
cy.get(".base-button[title='Edit']")
|
||||||
|
.click()
|
||||||
|
})
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Then('the new social media link shows up on the page', () => {
|
||||||
|
cy.get('a[href="https://freeradical.zone/peter-pan"]')
|
||||||
|
.should('have.length', 1)
|
||||||
|
})
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Then('the new url is displayed', () => {
|
||||||
|
cy.get("a[href='https://freeradical.zone/tinkerbell']")
|
||||||
|
.should('have.length', 1)
|
||||||
|
})
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import { Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Then('the old url is not displayed', () => {
|
||||||
|
cy.get("a[href='https://freeradical.zone/peter-pan']")
|
||||||
|
.should('have.length', 0)
|
||||||
|
})
|
||||||
|
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { Then } from "cypress-cucumber-preprocessor/steps";
|
||||||
|
|
||||||
|
Then('they should be able to see my social media links', () => {
|
||||||
|
cy.get('.base-card')
|
||||||
|
.contains('Where else can I find Peter Pan?')
|
||||||
|
.get('a[href="https://freeradical.zone/peter-pan"]')
|
||||||
|
.should('have.length', 1)
|
||||||
|
})
|
||||||
@ -15,79 +15,4 @@ Then('I should be on the {string} page', page => {
|
|||||||
})
|
})
|
||||||
.get('h2')
|
.get('h2')
|
||||||
.should('contain', 'Social media')
|
.should('contain', 'Social media')
|
||||||
})
|
})
|
||||||
|
|
||||||
When('I add a social media link', () => {
|
|
||||||
cy.get('input#addSocialMedia')
|
|
||||||
.type('https://freeradical.zone/peter-pan')
|
|
||||||
.get('button')
|
|
||||||
.contains('Add link')
|
|
||||||
.click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('it gets saved successfully', () => {
|
|
||||||
cy.get('.iziToast-message')
|
|
||||||
.should('contain', 'Added social media')
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('the new social media link shows up on the page', () => {
|
|
||||||
cy.get('a[href="https://freeradical.zone/peter-pan"]')
|
|
||||||
.should('have.length', 1)
|
|
||||||
})
|
|
||||||
|
|
||||||
Given('I have added a social media link', () => {
|
|
||||||
cy.openPage('/settings/my-social-media')
|
|
||||||
.get('input#addSocialMedia')
|
|
||||||
.type('https://freeradical.zone/peter-pan')
|
|
||||||
.get('button')
|
|
||||||
.contains('Add link')
|
|
||||||
.click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('they should be able to see my social media links', () => {
|
|
||||||
cy.get('.base-card')
|
|
||||||
.contains('Where else can I find Peter Pan?')
|
|
||||||
.get('a[href="https://freeradical.zone/peter-pan"]')
|
|
||||||
.should('have.length', 1)
|
|
||||||
})
|
|
||||||
|
|
||||||
When('I delete a social media link', () => {
|
|
||||||
cy.get(".base-button[title='Delete']")
|
|
||||||
.click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('it gets deleted successfully', () => {
|
|
||||||
cy.get('.iziToast-message')
|
|
||||||
.should('contain', 'Deleted social media')
|
|
||||||
})
|
|
||||||
|
|
||||||
When('I start editing a social media link', () => {
|
|
||||||
cy.get(".base-button[title='Edit']")
|
|
||||||
.click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('I can cancel editing', () => {
|
|
||||||
cy.get('button#cancel')
|
|
||||||
.click()
|
|
||||||
.get('input#editSocialMedia')
|
|
||||||
.should('have.length', 0)
|
|
||||||
})
|
|
||||||
|
|
||||||
When('I edit and save the link', () => {
|
|
||||||
cy.get('input#editSocialMedia')
|
|
||||||
.clear()
|
|
||||||
.type('https://freeradical.zone/tinkerbell')
|
|
||||||
.get('button')
|
|
||||||
.contains('Save')
|
|
||||||
.click()
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('the new url is displayed', () => {
|
|
||||||
cy.get("a[href='https://freeradical.zone/tinkerbell']")
|
|
||||||
.should('have.length', 1)
|
|
||||||
})
|
|
||||||
|
|
||||||
Then('the old url is not displayed', () => {
|
|
||||||
cy.get("a[href='https://freeradical.zone/peter-pan']")
|
|
||||||
.should('have.length', 0)
|
|
||||||
})
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
Feature: List Social Media Accounts
|
|
||||||
As a User
|
|
||||||
I'd like to enter my social media
|
|
||||||
So I can show them to other users to get in contact
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given I have a user account
|
|
||||||
And I am logged in
|
|
||||||
|
|
||||||
Scenario: Adding Social Media
|
|
||||||
Given I am on the "settings" page
|
|
||||||
And I click on the "Social media" link
|
|
||||||
Then I should be on the "/settings/my-social-media" page
|
|
||||||
When I add a social media link
|
|
||||||
Then it gets saved successfully
|
|
||||||
And the new social media link shows up on the page
|
|
||||||
|
|
||||||
Scenario: Other users viewing my Social Media
|
|
||||||
Given I have added a social media link
|
|
||||||
When people visit my profile page
|
|
||||||
Then they should be able to see my social media links
|
|
||||||
|
|
||||||
Scenario: Deleting Social Media
|
|
||||||
Given I am on the "settings" page
|
|
||||||
And I click on the "Social media" link
|
|
||||||
Then I should be on the "/settings/my-social-media" page
|
|
||||||
Given I have added a social media link
|
|
||||||
When I delete a social media link
|
|
||||||
Then it gets deleted successfully
|
|
||||||
|
|
||||||
Scenario: Editing Social Media
|
|
||||||
Given I am on the "settings" page
|
|
||||||
And I click on the "Social media" link
|
|
||||||
Then I should be on the "/settings/my-social-media" page
|
|
||||||
Given I have added a social media link
|
|
||||||
When I start editing a social media link
|
|
||||||
Then I can cancel editing
|
|
||||||
When I start editing a social media link
|
|
||||||
And I edit and save the link
|
|
||||||
Then it gets saved successfully
|
|
||||||
And the new url is displayed
|
|
||||||
But the old url is not displayed
|
|
||||||
Loading…
x
Reference in New Issue
Block a user