mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
update cypress tests
This commit is contained in:
parent
4a17cf0e07
commit
46616f5e6b
@ -112,7 +112,7 @@ Then("I add all required fields", () => {
|
||||
.get(".categories-select .base-button")
|
||||
.first()
|
||||
.click()
|
||||
.get('.ds-flex-item > .ds-form-item .ds-select ')
|
||||
.get('.base-card > .select-field input')
|
||||
.click()
|
||||
.get('.ds-select-option')
|
||||
.eq(languages.findIndex(l => l.code === 'en'))
|
||||
@ -120,7 +120,7 @@ Then("I add all required fields", () => {
|
||||
})
|
||||
|
||||
Then("the post was saved successfully with the {string} teaser image", condition => {
|
||||
cy.get(".ds-card-content > .ds-heading")
|
||||
cy.get(".base-card > .title")
|
||||
.should("contain", condition === 'updated' ? 'to be updated' : 'new post')
|
||||
.get(".content")
|
||||
.should("contain", condition === 'updated' ? 'successfully updated' : 'new post content')
|
||||
@ -129,25 +129,22 @@ Then("the post was saved successfully with the {string} teaser image", condition
|
||||
.and("contains", condition === 'updated' ? 'humanconnection' : 'onourjourney')
|
||||
})
|
||||
|
||||
Then("the first image should be removed from the preview", () => {
|
||||
cy.fixture("humanconnection.png").as('postTeaserImage').then(function() {
|
||||
cy.get("#postdropzone")
|
||||
.children()
|
||||
.get('img.thumbnail-preview')
|
||||
.should('have.length', 1)
|
||||
.and('have.attr', 'src')
|
||||
.and('contain', this.postTeaserImage)
|
||||
})
|
||||
Then("the first image should not be displayed anymore", () => {
|
||||
cy.get(".hero-image")
|
||||
.children()
|
||||
.get('.hero-image > .image')
|
||||
.should('have.length', 1)
|
||||
.and('have.attr', 'src')
|
||||
})
|
||||
|
||||
Then('the {string} post was saved successfully without a teaser image', condition => {
|
||||
cy.get(".ds-card-content > .ds-heading")
|
||||
cy.get(".base-card > .title")
|
||||
.should("contain", condition === 'updated' ? 'to be updated' : 'new post')
|
||||
.get(".content")
|
||||
.should("contain", condition === 'updated' ? 'successfully updated' : 'new post content')
|
||||
.get('.post-page')
|
||||
.should('exist')
|
||||
.get('.post-page img.ds-card-image')
|
||||
.get('.hero-image > .image')
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
@ -157,12 +154,12 @@ Then('I should be able to remove it', () => {
|
||||
})
|
||||
|
||||
When('my post has a teaser image', () => {
|
||||
cy.get('.contribution-image')
|
||||
cy.get('.contribution-form .image')
|
||||
.should('exist')
|
||||
.and('have.attr', 'src')
|
||||
})
|
||||
|
||||
Then('I should be able to remove the image', () => {
|
||||
cy.get('.delete-image')
|
||||
cy.get('.dz-message > .base-button')
|
||||
.click()
|
||||
})
|
||||
})
|
||||
|
||||
@ -295,7 +295,7 @@ Then("I select a category", () => {
|
||||
});
|
||||
|
||||
When("I choose {string} as the language for the post", (languageCode) => {
|
||||
cy.get('.contribution-form .ds-select ')
|
||||
cy.get('.contribution-form .ds-select')
|
||||
.click().get('.ds-select-option')
|
||||
.eq(languages.findIndex(l => l.code === languageCode)).click()
|
||||
})
|
||||
@ -582,7 +582,7 @@ Then("I see only one post with the title {string}", title => {
|
||||
cy.get(".main-container").contains(".post-link", title);
|
||||
});
|
||||
|
||||
Then("they should not see the comment from", () => {
|
||||
Then("they should not see the comment form", () => {
|
||||
cy.get(".base-card").children().should('not.have.class', 'comment-form')
|
||||
})
|
||||
|
||||
@ -602,11 +602,11 @@ Then("I {string} see {string} from the content menu in the user info box", (cond
|
||||
})
|
||||
|
||||
Then('I should not see {string} button', button => {
|
||||
cy.get('.ds-card-content .action-buttons')
|
||||
cy.get('.base-card .action-buttons')
|
||||
.should('have.length', 1)
|
||||
})
|
||||
|
||||
Then('I should see the {string} button', button => {
|
||||
cy.get('.ds-card-content .action-buttons .base-button')
|
||||
cy.get('.base-card .action-buttons .base-button')
|
||||
.should('contain', button)
|
||||
})
|
||||
|
||||
@ -35,7 +35,7 @@ Feature: Upload Teaser Image
|
||||
And confirm crop
|
||||
And I should be able to "change" a teaser image
|
||||
And confirm crop
|
||||
And the first image should be removed from the preview
|
||||
And the first image should not be displayed anymore
|
||||
|
||||
Scenario: Add image, then delete it
|
||||
When I click on the big plus icon in the bottom right corner to create post
|
||||
@ -44,4 +44,4 @@ Feature: Upload Teaser Image
|
||||
And I add all required fields
|
||||
And I click on "Save"
|
||||
Then I get redirected to ".../new-post"
|
||||
And the "new" post was saved successfully without a teaser image
|
||||
And the "new" post was saved successfully without a teaser image
|
||||
|
||||
@ -55,6 +55,6 @@ Feature: Block a User
|
||||
Scenario: Blocked users should not see link or button to unblock, only blocking users
|
||||
Given a user has blocked me
|
||||
When I visit the profile page of the annoying user
|
||||
And I "should not" see "Unblock user" from the content menu in the user info box
|
||||
And I should see the "Follow" button
|
||||
And I should not see "Unblock user" button
|
||||
And I should not see "Unblock user" button
|
||||
And I "should not" see "Unblock user" from the content menu in the user info box
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
'--blur-image': blurred,
|
||||
}"
|
||||
>
|
||||
<template #heroImage>
|
||||
<template #heroImage v-if="post.image">
|
||||
<img :src="post.image | proxyApiUrl" class="image" />
|
||||
<aside v-show="post.imageBlurred" class="blur-toggle">
|
||||
<img v-show="blurred" :src="post.image | proxyApiUrl" class="preview" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user