-
Notifications
You must be signed in to change notification settings - Fork 630
Cypress Tests - Batch 6 #3821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Asmaloth
wants to merge
10
commits into
webiny:next
Choose a base branch
from
Asmaloth:batch-6
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cypress Tests - Batch 6 #3821
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ca2668f
fix(pr): added solutions for batch 6 tasks 1 and 3
139f53c
fix(pr): added solutions for batch 6 task 2
61a39d0
fix(pr): refactored batch 6 task 1 for better readability
4f24857
fix(pr): made additional changes for batch 6
414a27d
Merge branch 'webiny:next' into batch-6
Asmaloth f2441b1
Merge branch 'next' into batch-6
adrians5j 730b1fc
fix(pr): made most of the changes as stated in the pr review
95618d3
fix(pr): made the final changes described in the pr
c3d659d
fix(pr): made additional changes to last commit
8cd3def
fix(pr): fixed the remaining bugs related to pbUpdatePageBlock
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 3 additions & 5 deletions
8
cypress-tests/cypress/e2e/admin/formBuilder/forms/createForm.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
cypress-tests/cypress/e2e/admin/pageBuilder/blocks/pageBlockPreview.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { generateAlphaLowerCaseId } from "@webiny/utils/generateId"; | ||
context("Page Builder - Blocks", () => { | ||
Asmaloth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
beforeEach(() => { | ||
cy.login(); | ||
cy.pbDeleteAllBlocks(); | ||
cy.pbDeleteAllBlockCategories(); | ||
cy.pbDeleteAllTemplates(); | ||
}); | ||
const blockName = ["Block1Name"]; | ||
const headerTitle = "Header test"; | ||
const headerTitleUpdate = "Edited Header Text"; | ||
const templateData = "tester"; | ||
|
||
const blockCategoryData = { | ||
name: generateAlphaLowerCaseId(10), | ||
slug: generateAlphaLowerCaseId(10), | ||
icon: "icon-name", | ||
description: generateAlphaLowerCaseId(10) | ||
}; | ||
|
||
it("Should be able to programatically create and assert a block exists with a proper heading", () => { | ||
cy.pbCreateCategoryAndBlocks({ | ||
blockCategory: blockCategoryData, | ||
blockNames: blockName, | ||
content: { | ||
type: "heading", | ||
text: headerTitle | ||
} | ||
}); | ||
|
||
cy.visit("/page-builder/page-blocks"); | ||
// Asserts the programatically created block contains the correct data. | ||
Asmaloth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cy.contains(blockCategoryData.name).click(); | ||
Asmaloth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cy.contains(blockName[0]).should("exist"); | ||
cy.contains(headerTitle).should("exist"); | ||
|
||
// Edits the current header for headerTitleUpdate. | ||
cy.findByTestId("pb-blocks-list-block-edit-btn").click(); | ||
cy.get('pb-block:contains("Header test")').click(); | ||
cy.get('[contenteditable="true"]').clear().type(headerTitleUpdate).click(); | ||
cy.contains("Save Changes").click(); | ||
|
||
// Asserts the newly edited header/block contains the right information. | ||
cy.contains(blockCategoryData.name).click(); | ||
cy.contains(blockName[0]).should("exist"); | ||
cy.contains(headerTitleUpdate).should("exist"); | ||
|
||
// Navigate to the template page and create a new template. | ||
cy.visit("/page-builder/page-templates"); | ||
cy.findAllByTestId("pb-templates-list-new-template-btn").click(); | ||
cy.findByRole("textbox", { name: "Title" }).type(templateData); | ||
cy.findByRole("textbox", { name: "Slug" }).type(templateData); | ||
cy.findByRole("textbox", { name: "Description" }).type(templateData); | ||
cy.findByRole("button", { name: "Create" }).click(); | ||
|
||
// Assert the block is being properly displayed. | ||
cy.findByTestId("pb-content-add-block-button").click(); | ||
cy.findByTestId("pb-editor-page-blocks-list-item-block-1-name").contains(headerTitleUpdate); | ||
|
||
// Add the block to the template. | ||
cy.contains(blockCategoryData.name).click(); | ||
cy.get('button[label="Click to Add"]').click({ force: true }); | ||
cy.contains("Save Changes").click(); | ||
|
||
// Assert the template is being displayed properly on the left and then the right side of the screen. | ||
cy.findByTestId("default-data-list") | ||
.find("li.mdc-list-item") | ||
.should("contain", templateData); | ||
cy.findByTestId("default-data-list").find("li.mdc-list-item").first().click(); | ||
cy.get('[data-testid="pb-page-templates-form"]').contains(headerTitleUpdate); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
cypress-tests/cypress/e2e/admin/pageBuilder/blocks/pageBlocksCrud.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 10 additions & 14 deletions
24
cypress-tests/cypress/e2e/admin/pageBuilder/blocks/pageBlocksExportImport.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 9 additions & 10 deletions
19
cypress-tests/cypress/e2e/admin/pageBuilder/category/pageCategoriesCrud.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
cypress-tests/cypress/e2e/admin/pageBuilder/menus/menuCrud.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
cypress-tests/cypress/e2e/admin/pageBuilder/menus/menuItems.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
cypress-tests/cypress/e2e/admin/pageBuilder/templates/pageTemplatesCrud.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 12 additions & 13 deletions
25
cypress-tests/cypress/e2e/admin/pageBuilder/templates/pageTemplatesDialogSearch.cy.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.