Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests/cypress/e2e/Form Templates/FormTemplates.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ describe("Form Templates page", () => {
cy.login();
cy.visit('/wp-admin/admin.php?page=formidable-form-templates');
cy.viewport(1280, 720);

});

it("should validate page content", () => {
Expand Down Expand Up @@ -266,7 +267,8 @@ describe("Form Templates page", () => {
it("add templates as favorites, view demo and use templates", () => {

cy.log("Add contact us template as favorite");
cy.get('li[frm-search-text="contact us"]').first()
cy.contains('li', 'Contact Us', { timeout: 10000 })
.first()
.trigger('mouseover', { force: true })
.find('.frm-form-templates-item-favorite-button')
.click({ force: true });
Expand All @@ -282,7 +284,8 @@ describe("Form Templates page", () => {
cy.get('[data-category="all-items"]').should("contain", "All Templates").click();

cy.log("View demo of the contact us template");
cy.get('li[frm-search-text="contact us"]').first()
cy.contains('li', 'Contact Us', { timeout: 10000 })
.first()
.trigger('mouseover', { force: true })
.find('.frm-button-secondary')
.invoke('removeAttr', 'target')
Expand All @@ -296,21 +299,24 @@ describe("Form Templates page", () => {

cy.visit('/wp-admin/admin.php?page=formidable-form-templates');

cy.get('li[frm-search-text="contact us"]').first()
cy.contains('li', 'Contact Us', { timeout: 10000 })
.first()
.trigger('mouseover', { force: true })
.find('.frm-form-templates-use-template-button')
.should("contain", "Use Template");

cy.log("Try to use available templates");
cy.get('[data-category="available-templates"]').should("contain", "Available Templates").click();
cy.get('#frm-form-templates-page-title-text').should("contain", "Available Templates");
cy.get('li[frm-search-text="contact us"]').first()
cy.contains('li', 'Contact Us', { timeout: 10000 })
.first()
.trigger('mouseover', { force: true })
.find('.frm-form-templates-use-template-button')
.should('contain', 'Use Template')
.click({ force: true });

cy.get('li[frm-search-text="contact us"]').first()
cy.contains('li', 'Contact Us', { timeout: 10000 })
.first()
.trigger('mouseover', { force: true })
.find('.frm-form-templates-use-template-button')
.should('contain', 'Use Template')
Expand Down
9 changes: 7 additions & 2 deletions tests/cypress/e2e/Forms/formPageDataValidation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe("Forms page", () => {
cy.visit('/wp-admin/admin.php?page=formidable');
cy.createNewForm(formTitle);
cy.viewport(1280, 720);

});

it("should validate all data in list view", () => {
Expand All @@ -25,12 +26,15 @@ describe("Forms page", () => {
const headingText = $h1.text();
expect([
'The Only WordPress Form Maker & Application Builder Plugin',
'Upgrade Today to Unlock the Full Power of Formidable Forms'
'Upgrade Today to Unlock the Full Power of Formidable Forms',
'The Most Advanced WordPress Form builder',
'More Than Just a WordPress Form builder'

]).to.include(headingText);
});
});
} else {
throw new Error(`Unexpected banner text or missing href: "${text}"`);
throw new Error(`Unexpected banner text or missing href: "${text}"`);
}
});

Expand Down Expand Up @@ -166,6 +170,7 @@ describe("Forms page", () => {
});

afterEach(() => {
cy.visit('/wp-admin/admin.php?page=formidable');
cy.deleteForm();
});
});
19 changes: 16 additions & 3 deletions tests/cypress/e2e/Forms/formsSettings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,14 @@ describe("Updating form settings", () => {

cy.get("#frm-previewDrop", { timeout: 5000 }).should("contain", "Preview").click();
cy.get('.preview > .frm-dropdown-menu > :nth-child(1) > a').should("contain", "On Blank Page").invoke('removeAttr', 'target').click();
cy.get("button[type='submit']").should("contain", "Submit").click();
cy.get('.frm_forms', { timeout: 10000 })
.should('be.visible')
.within(() => {
cy.get("button[type='submit'], input[type='submit']")
.filter(':visible')
.first()
.click();
});
Comment thread
Crabcyborg marked this conversation as resolved.

cy.log("Verify URL redirect after submitting form");
cy.origin('https://formidableforms.com', ()=> {
Expand All @@ -125,7 +132,14 @@ describe("Updating form settings", () => {
cy.log("Click on Preview - In Theme");
cy.get("#frm-previewDrop", { timeout: 5000 }).should("contain", "Preview").click();
cy.get('.preview > .frm-dropdown-menu > :nth-child(2) > a').should("contain", "In Theme").invoke('removeAttr', 'target').click();
cy.get("button[type='submit']").should("contain", "Submit").click();
cy.get('.frm_forms', { timeout: 10000 })
.should('be.visible')
.within(() => {
cy.get("button[type='submit'], input[type='submit']")
.filter(':visible')
.first()
.click();
});

cy.log("Verify URL redirect after submitting form");
cy.origin('https://formidableforms.com', ()=> {
Expand All @@ -138,5 +152,4 @@ describe("Updating form settings", () => {
cy.log("Teardown - Delete form");
cy.deleteForm();
});

});
Loading