diff --git a/tests/cypress/fixtures/color-palette.json b/tests/cypress/fixtures/color-palette.json new file mode 100644 index 000000000..1e4320986 --- /dev/null +++ b/tests/cypress/fixtures/color-palette.json @@ -0,0 +1,57 @@ +[ + { + "base": "#2E7D32", + "contrast": "#FFFFFF", + "primary": "#4CAF50", + "tertiary": "#C8E6C9", + "header_background": "#2E7D32", + "header_foreground": "#FFFFFF", + "header_tiles": "#C8E6C9", + "secondary_background": "#FFFFFF", + "secondary_foreground": "#2E7D32" + }, + { + "base": "#1565C0", + "contrast": "#FFFFFF", + "primary": "#2196F3", + "tertiary": "#BBDEFB", + "header_background": "#1565C0", + "header_foreground": "#FFFFFF", + "header_tiles": "#BBDEFB", + "secondary_background": "#FFFFFF", + "secondary_foreground": "#1565C0" + }, + { + "base": "#6A1B9A", + "contrast": "#FFFFFF", + "primary": "#9C27B0", + "tertiary": "#E1BEE7", + "header_background": "#6A1B9A", + "header_foreground": "#FFFFFF", + "header_tiles": "#E1BEE7", + "secondary_background": "#FFFFFF", + "secondary_foreground": "#6A1B9A" + }, + { + "base": "#E65100", + "contrast": "#FFFFFF", + "primary": "#FF5722", + "tertiary": "#FFCCBC", + "header_background": "#E65100", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFCCBC", + "secondary_background": "#FFFFFF", + "secondary_foreground": "#E65100" + }, + { + "base": "#FF6F00", + "contrast": "#FFFFFF", + "primary": "#FF9800", + "tertiary": "#FFE0B2", + "header_background": "#FF6F00", + "header_foreground": "#FFFFFF", + "header_tiles": "#FFE0B2", + "secondary_background": "#FFFFFF", + "secondary_foreground": "#FF6F00" + } +] diff --git a/tests/cypress/fixtures/content-structure.json b/tests/cypress/fixtures/content-structure.json new file mode 100644 index 000000000..0f243d96c --- /dev/null +++ b/tests/cypress/fixtures/content-structure.json @@ -0,0 +1,40 @@ +{ + "content_structures": [ + { + "structure": [ + "header", + "hero", + "headings", + "team", + "features", + "gallery", + "call-to-action", + "footer" + ] + }, + { + "structure": [ + "header", + "hero", + "headings", + "team", + "faq", + "testimonials", + "blog", + "footer" + ] + }, + { + "structure": [ + "header", + "hero", + "headings", + "team", + "gallery", + "call-to-action", + "contact", + "footer" + ] + } + ] +} diff --git a/tests/cypress/fixtures/content-tones.json b/tests/cypress/fixtures/content-tones.json new file mode 100644 index 000000000..7177e5d0f --- /dev/null +++ b/tests/cypress/fixtures/content-tones.json @@ -0,0 +1 @@ +{"tone":"Professional","undertone":"Positive","verbosity":2,"reading_level":60} diff --git a/tests/cypress/fixtures/font-pair.json b/tests/cypress/fixtures/font-pair.json new file mode 100644 index 000000000..6ef2a7909 --- /dev/null +++ b/tests/cypress/fixtures/font-pair.json @@ -0,0 +1,47 @@ +[ + { + "aesthetics": "modern", + "font_heading": "jost", + "font_content": "mulish", + "spacing": 2, + "radius": 4, + "font_heading_name": "Jost", + "font_content_name": "Mulish" + }, + { + "aesthetics": "minimalist", + "font_heading": "poppins", + "font_content": "source-sans-pro", + "spacing": 1, + "radius": 2, + "font_heading_name": "Poppins", + "font_content_name": "Source Sans Pro" + }, + { + "aesthetics": "vintage", + "font_heading": "playfair", + "font_content": "forum", + "spacing": 3, + "radius": 6, + "font_heading_name": "Playfair Display", + "font_content_name": "Forum" + }, + { + "aesthetics": "typographic", + "font_heading": "oswald", + "font_content": "merriweather", + "spacing": 2, + "radius": 4, + "font_heading_name": "Oswald", + "font_content_name": "Merriweather" + }, + { + "aesthetics": "retro", + "font_heading": "changa-one", + "font_content": "roboto-slab", + "spacing": 2, + "radius": 4, + "font_heading_name": "Changa One", + "font_content_name": "Roboto Slab" + } +] diff --git a/tests/cypress/fixtures/homepages.json b/tests/cypress/fixtures/homepages.json new file mode 100644 index 000000000..c823f7111 --- /dev/null +++ b/tests/cypress/fixtures/homepages.json @@ -0,0 +1,179 @@ +{ + "version-1": { + "slug": "version-1", + "title": "Version 1", + "isFavorite": false, + "content": "\n
\n \n\t
\n\t\t\"\"\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

Welcome to Asana: Your Yoga Studio in Cocoa Beach, Florida

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Discover the perfect balance of sustainability and wellness at Asana. Join our classes and

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t

— Welcome to Asana

\n\t\t\n\t\t\n\t\t

Discover the perfect balance of mind, body, and soul at our eco-conscious

\n\t\t\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

01

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Step

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

Outcome: Strategize

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

In the first step of our four-step process, we carefully plan and strategize our approach, taking into account the

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

02

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Step 2:

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

Outcome: Transform

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

In the second step of our four-step process, we implement our plan with dedication and passion, working towards

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

03

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Step 3:

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

Outcome: Achieve

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

In the third step of our four-step process, we execute the plan with precision and focus, ensuring

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

04

\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Step 4:

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

Outcome: Thrive

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

In the final step of our four-step process, we strive for excellence and aim to

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n\n
\n \n\t\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Discover the Power of Yoga

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t

Join Us for a Transformative Experience

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Experience the benefits of yoga at Asana, a sustainable yoga studio located in Cocoa Beach,

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n", + "header": "\n
\n\t
\n\t
\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t
\n\t
\n\t", + "footer": "\n
\n\t
\n\t
\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t
\n\t
\n\t\n\t\n\t\n\t
\n\t

© Copyright 2024. All rights reserved.

\n\t
\n\t
\n\t
\n\t", + "color": { + "slug": "palette-2", + "palette": [ + { + "slug": "base", + "name": "Base", + "color": "#1565C0" + }, + { + "slug": "contrast", + "name": "Contrast", + "color": "#FFFFFF" + }, + { + "slug": "primary", + "name": "Primary", + "color": "#2196F3" + }, + { + "slug": "tertiary", + "name": "Tertiary", + "color": "#BBDEFB" + }, + { + "slug": "header_background", + "name": "Header background", + "color": "#1565C0" + }, + { + "slug": "header_foreground", + "name": "Header foreground", + "color": "#FFFFFF" + }, + { + "slug": "header_tiles", + "name": "Header tiles", + "color": "#BBDEFB" + }, + { + "slug": "secondary_background", + "name": "Secondary background", + "color": "#FFFFFF" + }, + { + "slug": "secondary_foreground", + "name": "Secondary foreground", + "color": "#1565C0" + } + ] + }, + "generatedImages": [] + }, + "version-2": { + "slug": "version-2", + "title": "Version 2", + "isFavorite": false, + "content": "\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Welcome to Asana, your sustainable yoga studio in

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

🌿 Join us at Asana for a transformative yoga experience. Embrace sustainability and

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Popular tags:

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

sustainabil

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

yoga

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Our first employee, [Employee Name], is a [Employee Job Title] with a passion for yoga and sustainability. They bring [Employee Bio].

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t

[Employee Name]

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

[Employee Bio]

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Next, we have [Employee Name], our [Employee Job Title]. [Employee Bio].

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t

[Employee Name]

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

[Employee Bio]

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Lastly, we have [Employee Name], our [Employee Job Title]. [Employee Bio].

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t

[Employee Name]

\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

[Employee Bio]

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Welco

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t

Discover the transformative power of yoga at Asana. With thousands of visitors already experiencing the benefits, it's

\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t
\n\t\n \n
\n \n", + "header": "\n
\n
\n \n \n \n \n
\n

T: Contact us at 123-456-7890

\n \n \n \n \n
\n
\n
\n ", + "footer": "\n
\n\t
\n\t
\n\t
\n\t

Welcome to Asana, your premier yoga studio in Cocoa Beach, Florida. We are committed

\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t

Copyright © 2024, Company LLC

1412 Main Street
Suite 51
New York, NY 10001

\n\t
\n\t
\n\t\n\t\n\t\n\t
\n\t

About

\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t

Helpful Tools

\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t

Learn More

\n\t\n\t\n\t
\n\t
\n\t
\n\t", + "color": { + "slug": "palette-2", + "palette": [ + { + "slug": "base", + "name": "Base", + "color": "#1565C0" + }, + { + "slug": "contrast", + "name": "Contrast", + "color": "#FFFFFF" + }, + { + "slug": "primary", + "name": "Primary", + "color": "#2196F3" + }, + { + "slug": "tertiary", + "name": "Tertiary", + "color": "#BBDEFB" + }, + { + "slug": "header_background", + "name": "Header background", + "color": "#1565C0" + }, + { + "slug": "header_foreground", + "name": "Header foreground", + "color": "#FFFFFF" + }, + { + "slug": "header_tiles", + "name": "Header tiles", + "color": "#BBDEFB" + }, + { + "slug": "secondary_background", + "name": "Secondary background", + "color": "#FFFFFF" + }, + { + "slug": "secondary_foreground", + "name": "Secondary foreground", + "color": "#1565C0" + } + ] + }, + "generatedImages": [] + }, + "version-3": { + "slug": "version-3", + "title": "Version 3", + "isFavorite": false, + "content": "\n
\n \n\t
\n\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

Discover the Power of

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

Welcome to Asana: Your Yoga Studio in Cocoa Beach

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t

At Asana, we prioritize sustainability and offer a curated selection of eco-conscious yoga attire, accessories, and

\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\"\"
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\"\"
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t
\n\t\n \n
\n \n\n
\n \n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

What are your class

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

We offer a variety of classes for all levels, including Vinyasa, Hatha, and Yin yoga. Our experienced instructors guide you through each session to help you deepen

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

How can I purchase yoga attire and

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

You can browse and purchase our curated selection of yoga attire and accessories in our studio or through our online store. We prioritize sustainability and

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Do you offer eco-friendly yoga mats?

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Yes, we prioritize sustainability and source our yoga mats from eco-conscious suppliers here in the USA. Our mats are made from eco-friendly materials to support your

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

What are your studio hours?

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Our studio is open Monday to Friday from 8:00 AM to 8:00 PM, and on weekends from 9:00 AM to 6:00 PM. Please check our schedule

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

Where is your studio located?

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Our yoga studio, Asana, is located in Cocoa Beach, Florida. We are conveniently situated in the heart of the city, making it easily accessible for residents and visitors alike.

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t

How can I contact your studio?

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

You can reach out to us through our contact form on our website or give us a call at (123) 456-7890. We're

\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n\t\n\t
\n\t\t\n\t\t
\n\t\t\t\n\t\t\t
\"\"
\n\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t

Need assistance or have a

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t

We're here to help! Feel free to reach out to us with any inquiries or

\n\t\t\t\t\n\t\t\t
\n\t\t\t\n\t\t
\n\t\t\n\t\t\n\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t
\n\t\n \n
\n \n", + "header": "\n
\n\t
\n\t
\n\t

Welcome to Asana, the premier yoga studio in Cocoa Beach, Florida. Discover the perfect balance of

\n\t
\n\t
\n\t\n\t\n\t\n\t
\n\t
\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t
\n\t
\n\t
\n\t", + "footer": "\n
\n\t
\n\t\n\t\n\t
\n\t

Looking to build a website? Get expert help at Asana,

\n\t\n\t\n\t\n\t
\n\t

Stay updated with current affairs, discover services, and stay connected to social media at Asana, your favorite yoga studio in Cocoa Beach, Florida.

\n\t
\n\t
\n\t\n\t\n\t\n\t\n\t
\n\t\n\t\n\t\n\t
\n\t

© 2024, Company LLC

\n\t\n\t\n\t\n\t\n\t
\n\t
\n\t", + "color": { + "slug": "palette-5", + "palette": [ + { + "slug": "base", + "name": "Base", + "color": "#FF6F00" + }, + { + "slug": "contrast", + "name": "Contrast", + "color": "#FFFFFF" + }, + { + "slug": "primary", + "name": "Primary", + "color": "#FF9800" + }, + { + "slug": "tertiary", + "name": "Tertiary", + "color": "#FFE0B2" + }, + { + "slug": "header_background", + "name": "Header background", + "color": "#FF6F00" + }, + { + "slug": "header_foreground", + "name": "Header foreground", + "color": "#FFFFFF" + }, + { + "slug": "header_tiles", + "name": "Header tiles", + "color": "#FFE0B2" + }, + { + "slug": "secondary_background", + "name": "Secondary background", + "color": "#FFFFFF" + }, + { + "slug": "secondary_foreground", + "name": "Secondary foreground", + "color": "#FF6F00" + } + ] + }, + "generatedImages": [] + } + } diff --git a/tests/cypress/fixtures/plugin-recommendation.json b/tests/cypress/fixtures/plugin-recommendation.json new file mode 100644 index 000000000..7b930408a --- /dev/null +++ b/tests/cypress/fixtures/plugin-recommendation.json @@ -0,0 +1,105 @@ +{ + "requiredPlugins": [ + { + "title": "Yoast SEO", + "description": "Yoast SEO is a comprehensive search engine optimization plugin for WordPress, which offers various features to optimize your site for maximum visibility in search engines.", + "slug": "wordpress-seo", + "path": "wordpress-seo\/wordpress-seo.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/wordpress-seo.zip", + "premium": false, + "requires": [] + }, + { + "title": "Jetpack", + "description": "Jetpack offers a suite of design, security, and marketing tools for WordPress sites, including real-time backups and easy-to-use performance enhancements.", + "slug": "jetpack", + "path": "jetpack\/jetpack.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/jetpack.zip", + "premium": false, + "requires": [] + }, + { + "title": "WooCommerce", + "description": "WooCommerce is a customizable, open-source eCommerce platform built on WordPress, allowing users to set up online stores with ease.", + "slug": "woocommerce", + "path": "woocommerce\/woocommerce.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/woocommerce.zip", + "premium": false, + "requires": [] + } + ], + "recommendedPlugins": [ + { + "title": "Creative Mail", + "description": "Creative Mail is an email marketing plugin designed to seamlessly integrate with WordPress, offering intuitive tools for crafting and sending newsletters.", + "slug": "creative-mail-by-constant-contact", + "path": "creative-mail-by-constant-contact\/creative-mail-plugin.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/creative-mail-by-constant-contact.zip", + "premium": false, + "requires": [] + }, + { + "title": "MonsterInsights", + "description": "MonsterInsights provides a powerful Google Analytics plugin for WordPress, making it easy to connect and view website analytics directly from the dashboard.", + "slug": "google-analytics-for-wordpress", + "path": "google-analytics-for-wordpress\/googleanalytics.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/google-analytics-for-wordpress.zip", + "premium": false, + "requires": [] + }, + { + "title": "OptinMonster", + "description": "OptinMonster is a lead generation tool for WordPress, offering features like pop-ups, floating bars, and slide-ins to capture user information.", + "slug": "optinmonster", + "path": "optinmonster\/optin-monster-wp-api.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/optinmonster.zip", + "premium": false, + "requires": [] + }, + { + "title": "WPForms Lite", + "description": "WPForms Lite is a drag-and-drop form builder for WordPress, allowing users to create contact forms, surveys, and more without any coding.", + "slug": "wpforms-lite", + "path": "wpforms-lite\/wpforms.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/wpforms-lite.zip", + "premium": false, + "requires": [] + }, + { + "title": "YITH Product Search Extended Version", + "description": "An extended version of YITH's product search plugin for WooCommerce, enhancing search capabilities.", + "slug": "yith-product-search-extended", + "path": "yith-product-search-extended\/yith-product-search-extended.php", + "download_url": "https:\/\/downloads.wordpress.org\/plugin\/yith-product-search-extended.zip", + "premium": false, + "requires": [] + }, + { + "title": "YITH Product Filter Extended Version", + "description": "An extended version of YITH's product filter plugin for WooCommerce, enhancing product filtering capabilities.", + "slug": "nfd_slug_yith_woocommerce_ajax_product_filter", + "path": "yith-woocommerce-ajax-product-filter-extended\/init.php", + "download_url": "https:\/\/hiive.cloud\/workers\/plugin-downloads\/yith-woocommerce-ajax-product-filter", + "premium": false, + "requires": [] + }, + { + "title": "YITH Bookings Extended Version", + "description": "An extended version of YITH's booking plugin for WooCommerce, allowing users to book products or services.", + "slug": "nfd_slug_yith_woocommerce_booking", + "path": "yith-woocommerce-booking-extended\/init.php", + "download_url": "https:\/\/hiive.cloud\/workers\/plugin-downloads\/yith-woocommerce-booking", + "premium": false, + "requires": [] + }, + { + "title": "YITH Wishlist Extended Version", + "description": "An extended version of YITH's wishlist plugin for WooCommerce, allowing users to create and manage wishlists.", + "slug": "nfd_slug_yith_woocommerce_wishlist", + "path": "yith-woocommerce-wishlist-extended\/init.php", + "download_url": "https:\/\/hiive.cloud\/workers\/plugin-downloads\/yith-woocommerce-wishlist", + "premium": false, + "requires": [] + } + ] +} diff --git a/tests/cypress/fixtures/site-classification.json b/tests/cypress/fixtures/site-classification.json new file mode 100644 index 000000000..7b232c925 --- /dev/null +++ b/tests/cypress/fixtures/site-classification.json @@ -0,0 +1,23 @@ +{ + "primaryType": "business", + "slug": "shopping-retail", + "emoji": "\ud83c\udfec", + "wooType": "other", + "schema": "Store", + "keywords": [ + "commerce", + "brick-and-mortar", + "discounts", + "coupons", + "customer", + "product", + "loyalty", + "inventory", + "shipping", + "returns", + "cross-sell", + "upsell", + "gift cards" + ], + "label": "Shopping & Retail" +} diff --git a/tests/cypress/fixtures/site-config.json b/tests/cypress/fixtures/site-config.json new file mode 100644 index 000000000..6184fca15 --- /dev/null +++ b/tests/cypress/fixtures/site-config.json @@ -0,0 +1,4 @@ +{ + "site_title": "Asana Yoga Studio", + "tagline": "Elevate your practice with sustainable yoga essentials" +} diff --git a/tests/cypress/fixtures/sitemap.json b/tests/cypress/fixtures/sitemap.json new file mode 100644 index 000000000..1cedb7b09 --- /dev/null +++ b/tests/cypress/fixtures/sitemap.json @@ -0,0 +1,68 @@ +[ + { + "slug": "home", + "path": "\/", + "title": "Asana Yoga Studio", + "keywords": [ + "yoga studio", + "Cocoa Beach", + "Florida", + "sustainability", + "yoga mats", + "eco-conscious suppliers" + ] + }, + { + "slug": "classes", + "path": "\/classes", + "title": "Yoga Classes", + "keywords": [ + "yoga classes", + "Cocoa Beach", + "Florida" + ] + }, + { + "slug": "attire", + "path": "\/attire", + "title": "Yoga Attire", + "keywords": [ + "yoga attire", + "Cocoa Beach", + "Florida" + ] + }, + { + "slug": "accessories", + "path": "\/accessories", + "title": "Yoga Accessories", + "keywords": [ + "yoga accessories", + "Cocoa Beach", + "Florida" + ] + }, + { + "slug": "about", + "path": "\/about", + "title": "About Us", + "keywords": [ + "about us", + "yoga studio", + "Cocoa Beach", + "Florida", + "sustainability" + ] + }, + { + "slug": "contact", + "path": "\/contact", + "title": "Contact Us", + "keywords": [ + "contact us", + "yoga studio", + "Cocoa Beach", + "Florida" + ] + } +] diff --git a/tests/cypress/fixtures/target-audience.json b/tests/cypress/fixtures/target-audience.json new file mode 100644 index 000000000..5c2e32396 --- /dev/null +++ b/tests/cypress/fixtures/target-audience.json @@ -0,0 +1,19 @@ +{ + "location": "Cocoa Beach, Florida", + "interests": [ + "yoga", + "sustainability", + "eco-conscious living" + ], + "age": { + "min": 18, + "max": 65 + }, + "gender": "All", + "income": { + "min": 0, + "max": 100000, + "currency": "USD" + }, + "education": "All" +} diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js index 53420bdb8..abaf39c81 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js @@ -1,12 +1,33 @@ // -import { AdminBarCheck, BackButtonCheck, DarkBGCheck, DisabledNextButton, LightBGCheck, ProgressBarCheck, SkipButtonCheck } from '../wp-module-support/siteGen.cy'; +import { + AdminBarCheck, + BackButtonCheck, + DarkBGCheck, + DisabledNextButton, + LightBGCheck, + ProgressBarCheck, + SkipButtonCheck, +} from '../wp-module-support/siteGen.cy'; +import { + apiList, + siteGenMockAll, + homePagesMock, +} from '../wp-module-support/MockApi.cy'; -describe( 'SiteGen Site Logo Step', function() { +describe( 'SiteGen Site Logo Step', function () { before( () => { - cy.visit( - 'wp-admin/?page=nfd-onboarding#/sitegen/step/site-logo' - ); + cy.intercept( apiList.sitegen, ( req ) => { + siteGenMockAll( req ); + } ).as( 'sitegenCalls' ); + + cy.intercept( apiList.homepages, ( req ) => { + homePagesMock( req ); + } ).as( 'homePageCall' ); + + cy.visit( 'wp-admin/?page=nfd-onboarding#/sitegen/step/site-logo' ); + cy.wait( '@sitegenCalls', { timeout: 60000 } ); + cy.wait( '@homePageCall', { timeout: 60000 } ); } ); it( 'Check for the header admin bar', () => { @@ -30,7 +51,7 @@ describe( 'SiteGen Site Logo Step', function() { } ); it( 'Check if the heading is visible', () => { - cy.get( '.ai-heading', {timeout:20000} ).should( 'be.visible' ); + cy.get( '.ai-heading', { timeout: 20000 } ).should( 'be.visible' ); } ); it( 'Check for the skip button', () => { @@ -43,26 +64,32 @@ describe( 'SiteGen Site Logo Step', function() { it.skip( 'Check if Image gets uploaded', () => { const sampleLogoPath = `vendor/newfold-labs/wp-module-onboarding/tests/cypress/fixtures/image.png`; - const LogoPreviewClass = '.nfd-onboarding-image-uploader--with-text__site_logo__preview'; + const LogoPreviewClass = + '.nfd-onboarding-image-uploader--with-text__site_logo__preview'; if ( - cy.get( '.nfd-onboarding-button--site-gen-next--disabled' ) + cy + .get( '.nfd-onboarding-button--site-gen-next--disabled' ) .should( 'be.visible' ) ) { - cy.get( LogoPreviewClass ) - .should( 'not.exist' ); + cy.get( LogoPreviewClass ).should( 'not.exist' ); } cy.get( 'input[type=file]', { timeout: 180000 } ) .should( 'exist' ) .selectFile( sampleLogoPath, { force: true } ) .then( () => { cy.wait( 2000 ); - cy.get( LogoPreviewClass, { timeout: 60000 } ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-image-uploader--with-text__site_logo__preview__reset__button' ) + cy.get( LogoPreviewClass, { timeout: 60000 } ).should( + 'be.visible' + ); + cy.get( + '.nfd-onboarding-image-uploader--with-text__site_logo__preview__reset__button' + ) .scrollIntoView() .should( 'be.visible' ); } ); - cy.get( '.nfd-onboarding-button--site-gen-next' ) - .should( 'not.be.disabled' ); + cy.get( '.nfd-onboarding-button--site-gen-next' ).should( + 'not.be.disabled' + ); } ); it.skip( 'Check if the Next Button is enabled and go next', () => { diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js index d6ec4a788..7e90ecb9e 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js @@ -1,6 +1,12 @@ // -import { AdminBarCheck, BackButtonCheck, DarkBGCheck, ExperienceDetails, LightBGChcek, ProgressBarCheck} from "../wp-module-support/siteGen.cy"; +import { + AdminBarCheck, + DarkBGCheck, + ExperienceDetails, + LightBGCheck, + ProgressBarCheck, +} from '../wp-module-support/siteGen.cy'; describe( 'SiteGen Experience & Site Building Step', function () { before( () => { @@ -9,56 +15,47 @@ describe( 'SiteGen Experience & Site Building Step', function () { ); } ); - it.skip( 'Check for the header admin bar', () => { - AdminBarCheck(); - } ); + it( 'Check for the header admin bar', () => { + AdminBarCheck(); + } ); - it.skip( 'Check for the existing dark background', () => { + it( 'Check for the existing dark background', () => { DarkBGCheck(); } ); - it.skip( 'Check for the light background', () => { - LightBGChcek(); - } ); - - it.skip( 'Check the Progress Bar Value', () => { - ProgressBarCheck('50%'); - }); + it( 'Check for the light background', () => { + LightBGCheck(); + } ); - it.skip( 'Check for back button and go back', () => { - BackButtonCheck('sitegen/step/experience'); - } ); + it( 'Check the Progress Bar Value', () => { + ProgressBarCheck( '57.1429%' ); + } ); - it.skip( 'Check for the existence & the count of experience level cards', () => { - cy.get( '.nfd-sg-experience-level' ).should('be.visible'); - cy.get( '.nfd-sg-loader' ).should('be.visible'); - cy.get( '.nfd-sg-card' ).should('be.visible'); - cy.get( '.nfd-sg-card__data__option' ).should('have.length',3) - } ); + it( 'Check for the existence & the count of experience level cards', () => { + cy.get( '.nfd-sg-experience-level' ).should( 'be.visible' ); + cy.get( '.nfd-sg-loader' ).should( 'be.visible' ); + cy.get( '.nfd-sg-card' ).should( 'be.visible' ); + cy.get( '.nfd__option_heading_subheading__wrapper' ).should( + 'have.length', + 3 + ); + } ); - it.skip( 'Check and click each experience cards', () => { - const className = '.nfd-sg-card__data__option' - let options = 0; - const arr = cy.get( className ); + it( 'Check each experience cards', () => { + const className = '.nfd__option_heading_subheading__wrapper'; + let options = 0; + const arr = cy.get( className ); arr.each( () => { - if(options == 0){ - ExperienceDetails(className,'Beginner',options); - }; - if(options == 1){ - ExperienceDetails(className,'Used it some',options); - }; - if(options == 2){ - ExperienceDetails(className, 'Expert',options); - }; - options+=1; - }); - } ); - - it.skip( 'Check for the existence of skip button and click', () => { - cy.get( '.nfd-sg-card__skip' ) - .scrollIntoView() - .should('be.visible') - .click(); - cy.url().should('not.contain', 'sitegen/step/experience'); - } ); -}); + if ( options == 0 ) { + ExperienceDetails( className, 'Beginner', options ); + } + if ( options == 1 ) { + ExperienceDetails( className, 'Intermediate', options ); + } + if ( options == 2 ) { + ExperienceDetails( className, 'Expert', options ); + } + options += 1; + } ); + } ); +} ); diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js index 32be07697..708616f94 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js @@ -1,89 +1,103 @@ // -import { AdminBarCheck, BackButtonCheck, DarkBGCheck, LightBGCheck, ProgressBarCheck } from "../wp-module-support/siteGen.cy"; +import { + AdminBarCheck, + DarkBGCheck, + LightBGCheck, + ProgressBarCheck, +} from '../wp-module-support/siteGen.cy'; describe( 'SiteGen Site Preview Step', function () { - before( () => { - cy.visit( - 'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview' - ); - cy.wait(5000); - } ); + before( () => { + cy.visit( + 'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview' + ); + cy.wait( 5000 ); + } ); - it.skip( 'Check for the header admin bar', () => { - AdminBarCheck(); - } ); + it( 'Check for the header admin bar', () => { + AdminBarCheck(); + } ); - it.skip( 'Check for the existing dark background', () => { - DarkBGCheck(); - } ); + it( 'Check for the existing dark background', () => { + DarkBGCheck(); + } ); - it.skip( 'Check for the light background', () => { - LightBGCheck(); - } ); + it( 'Check for the light background', () => { + LightBGCheck(); + } ); - it.skip( 'Check the Progress Bar Value', () => { - ProgressBarCheck('75%'); - }); + it( 'Check the Progress Bar Value', () => { + ProgressBarCheck( '71.4286%' ); + } ); - it.skip( 'Check for back button and go back', () => { - BackButtonCheck('sitegen/step/preview'); - cy.visit('wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview'); - cy.reload(); - } ); + it( 'Check for by default 3 versions should be there', () => { + cy.get( '.live-preview-sitegen--selectable-card', { timeout: 20000 } ) + .should( 'be.visible' ) + .should( 'have.length', 3 ); + } ); - it.skip( 'Check for by default 3 versions should be there', () => { - cy.get('.live-preview-sitegen--selectable-card', {timeout:20000}) - .should('be.visible') - .should('have.length', 3); - } ); + it( 'Check for the favourited theme versions', () => { + cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]' ).should( + 'not.exist' + ); // when no fav theme is selected + cy.get( + '.live-preview-sitegen--selectable-card__live-preview-container-buttons__button__icon' + ) + .eq( 0 ) + .scrollIntoView() + .should( 'be.visible' ) + .click(); + cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]', { + timeout: 20000, + } ).should( 'exist' ); + cy.get( + '.live-preview-sitegen--selectable-card__live-preview-container__overlay' + ) + .eq( 0 ) + .scrollIntoView() + .click(); + cy.reload(); + cy.wait( 5000 ); + cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]', { + timeout: 20000, + } ).should( 'exist' ); + cy.go( 'back' ); + cy.reload(); + } ); - it.skip( 'Check for the favourited theme versions', () => { - cy.get('g[clip-path="url(#heart-filled_svg__a)"]').should('not.exist'); // when no fav theme is selected - cy.get( '.live-preview-sitegen--selectable-card__live-preview-container-buttons__button__icon' ) - .eq(0) - .scrollIntoView() - .should('be.visible') - .click(); - cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:10000} ) - .should('exist'); - cy.get('.live-preview-sitegen--selectable-card__live-preview-container__overlay') - .eq(0) - .scrollIntoView() - .click(); - cy.reload(); - cy.wait(5000); - cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:10000} ) - .should('exist'); - cy.go('back'); - cy.reload(); - } ); + it.skip( 'Check for regenerating the new theme versions', () => { + cy.get( '[aria-label="Regenerate Content"]', { timeout: 20000 } ) + .eq( 1 ) + .wait( 1000 ) + .click( { force: true } ); + cy.get( '[aria-label="Regenerate Content"]', { timeout: 20000 } ) + .eq( 2 ) + .scrollIntoView(); + cy.get( '.live-preview-sitegen--selectable-card', { timeout: 20000 } ) + .should( 'be.visible' ) + .should( 'have.length', 4 ); + } ); - it.skip( 'Check for regenerating the new theme versions', () => { - cy.get('[aria-label="Regenerate Content"]', {timeout:10000}) - .eq(2) - .scrollIntoView() - .click(); - cy.wait(3000); - cy.get('.live-preview-sitegen--selectable-card') - .should('be.visible') - .should('have.length', 4); - } ); + it( 'Check for the preview note at the bottom', () => { + cy.get( '.nfd-onboarding-step--site-gen__preview__note' ) + .scrollIntoView() + .should( 'be.visible' ); + cy.get( 'g[id="State\\=Active"]' ).should( 'exist' ); + cy.get( '.nfd-onboarding-step--site-gen__preview__note span' ) + .scrollIntoView() + .contains( 'Favorite' ); + } ); - it.skip( 'Check for the preview note at the bottom', () => { - cy.get('.nfd-onboarding-step--site-gen__preview__note') - .scrollIntoView() - .should('be.visible'); - cy.get('g[id="State\\=Active"]').should('exist'); - cy.get('.nfd-onboarding-step--site-gen__preview__note span').scrollIntoView().contains('Favorite'); - } ); - - it.skip( 'Select any theme and go forward to the next step', () => { - cy.get('.live-preview-sitegen--selectable-card') - .eq(0) - .scrollIntoView() - .click(); - cy.wait(5000); - cy.url().should('not.contain', 'sitegen/step/preview'); - } ); -}); + it( 'Select any theme and go forward to the next step', () => { + cy.get( + '.live-preview-sitegen--selectable-card__live-preview-container__overlay', + { timeout: 10000 } + ) + .eq( 0 ) + .click(); + cy.url().should( 'not.contain', 'sitegen/step/preview', { + timeout: 20000, + } ); + } ); +} ); diff --git a/tests/cypress/integration/wp-module-support/MockApi.cy.js b/tests/cypress/integration/wp-module-support/MockApi.cy.js new file mode 100644 index 000000000..3e3822c39 --- /dev/null +++ b/tests/cypress/integration/wp-module-support/MockApi.cy.js @@ -0,0 +1,54 @@ +const site_config_mock = require( '../../fixtures/site-config.json' ); +const site_classification_mock = require( '../../fixtures/site-classification.json' ); +const target_audience_mock = require( '../../fixtures/target-audience.json' ); +const content_tones_mock = require( '../../fixtures/content-tones.json' ); +const content_structure_mock = require( '../../fixtures/content-structure.json' ); +const color_palette_mock = require( '../../fixtures/color-palette.json' ); +const sitemap_mock = require( '../../fixtures/sitemap.json' ); +const plugin_recommendation_mock = require( '../../fixtures/plugin-recommendation.json' ); +const font_pair_mock = require( '../../fixtures/font-pair.json' ); +const homepages_mock = require( '../../fixtures/homepages.json' ); + +export const apiList = { + sitegen: + '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fsitegen%2Fgenerate&flow=sitegen&_locale=user', + homepages: + '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fsitegen%2Fhomepages&flow=sitegen&_locale=user', + homepagesRegenerate: + '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fsitegen%2Fhomepages%2Fregenerate&flow=sitegen&_locale=user', +}; + +export const siteGenMockAll = ( req ) => { + const requestBody = req.body; + const sitegen_identifiers = { + 'site_config': site_config_mock, + 'site_classification': site_classification_mock, + 'target_audience': target_audience_mock, + 'content_tones': content_tones_mock, + 'content_structure': content_structure_mock, + 'color_palette': color_palette_mock, + 'sitemap': sitemap_mock, + 'plugin_recommendation': plugin_recommendation_mock, + 'font_pair': font_pair_mock, + }; + + if ( sitegen_identifiers.hasOwnProperty( requestBody.identifier ) ) { + req.reply( { + statusCode: 200, + body: sitegen_identifiers[ requestBody.identifier ], + headers: { + 'content-type': 'application/json', + }, + } ); + } +}; + +export const homePagesMock = ( req ) => { + req.reply( { + statusCode: 200, + body: homepages_mock, + headers: { + 'content-type': 'application/json', + }, + } ); +}; diff --git a/tests/cypress/integration/wp-module-support/siteGen.cy.js b/tests/cypress/integration/wp-module-support/siteGen.cy.js index cbd9e7a70..6bb5ec852 100644 --- a/tests/cypress/integration/wp-module-support/siteGen.cy.js +++ b/tests/cypress/integration/wp-module-support/siteGen.cy.js @@ -1,77 +1,67 @@ // export const AdminBarCheck = () => { - cy.get( '.nfd-onboarding-header__admin-bar', {timeout:120000} ).should('be.visible'); + cy.get( '.nfd-onboarding-header__admin-bar', { timeout: 120000 } ).should( + 'be.visible' + ); }; -export const DarkBGCheck = () => { - cy.wait( 2000 ); - // When the page loads, it should have dark background by default - cy.get('.nfd-onboarding-sitegen-dark').should('be.visible'); +export const DarkBGCheck = () => { + cy.wait( 2000 ); + // When the page loads, it should have dark background by default + cy.get( '.nfd-onboarding-sitegen-dark' ).should( 'be.visible' ); }; export const LightBGCheck = () => { - cy.get( '.nfd-onboarding-toggle__theme__button__dark' ) - .should( 'exist' ) - .click(); - cy.get( '.nfd-onboarding-sitegen-light' ).should('be.visible'); - // Now changing the background back to dark - cy.get( '.nfd-onboarding-toggle__theme__button__light' ) - .should( 'exist' ) - .click(); - cy.get('.nfd-onboarding-sitegen-dark').should('be.visible'); + cy.get( '.nfd-onboarding-toggle__theme__button__dark' ) + .should( 'exist' ) + .click(); + cy.get( '.nfd-onboarding-sitegen-light' ).should( 'be.visible' ); + // Now changing the background back to dark + cy.get( '.nfd-onboarding-toggle__theme__button__light' ) + .should( 'exist' ) + .click(); + cy.get( '.nfd-onboarding-sitegen-dark' ).should( 'be.visible' ); }; -export const OptionsDetails = (className,textValue,optionsValue) => { - cy.get(className, {timeout:10000}) - .eq(optionsValue) - .find('.nfd-onboarding-sitegen-options__container__heading__title') - .invoke( 'text' ) - .should('contain', textValue); +export const OptionsDetails = ( className, textValue, optionsValue ) => { + cy.get( className, { timeout: 10000 } ) + .eq( optionsValue ) + .find( '.nfd-onboarding-sitegen-options__container__heading__title' ) + .invoke( 'text' ) + .should( 'contain', textValue ); }; export const ProgressBarCheck = ( WidthPercent ) => { - cy.get('.nfd-onboarding-header__progress-bar').should('be.visible'); - cy.get('.nfd-onboarding-header__progress-bar__progress') - .invoke('attr', 'style') - .then((styleAttribute) => { - const value = styleAttribute.match(/width:\s*([\d.]+%)/)[1]; - expect(value).equal(WidthPercent); - }); + cy.get( '.nfd-onboarding-header__progress-bar' ).should( 'be.visible' ); + cy.get( '.nfd-onboarding-header__progress-bar__progress' ) + .invoke( 'attr', 'style' ) + .then( ( styleAttribute ) => { + const value = styleAttribute.match( /width:\s*([\d.]+%)/ )[ 1 ]; + expect( value ).equal( WidthPercent ); + } ); }; -export const BackButtonCheck = (currURL) => { - cy.get('.nfd-onboarding-button--dark') - .should('be.visible') - .click(); - cy.url().should('not.contain', currURL); - cy.go('back'); +export const BackButtonCheck = ( currURL ) => { + cy.get( '.nfd-onboarding-button--dark' ).should( 'be.visible' ).click(); + cy.url().should( 'not.contain', currURL ); + cy.go( 'back' ); }; export const SkipButtonCheck = () => { - cy.get('.skip-button') - .should('be.visible') - .contains('Skip for now'); + cy.get( '.skip-button' ).should( 'be.visible' ).contains( 'Skip for now' ); }; export const DisabledNextButton = () => { - cy.get('.nfd-onboarding-button--site-gen-next--disabled') - .should('be.visible') - .contains( 'Next' ); + cy.get( '.nfd-onboarding-button--site-gen-next--disabled' ) + .should( 'be.visible' ) + .contains( 'Next' ); }; -export const ExperienceDetails = (classname,textValue,optionsValue) => { - cy.get(classname) - .eq(optionsValue) - .find('.nfd-sg-card__data__option__left_top') - .invoke( 'text' ) - .should('contain', textValue); - cy.get(classname) - .eq(optionsValue) - .click(); - cy.url().should('not.include', 'sitegen/step/experience',{ - timeout: 10000, - } ); - cy.go('back'); - cy.wait(2000); +export const ExperienceDetails = ( classname, textValue, optionsValue ) => { + cy.get( classname ) + .eq( optionsValue ) + .find( '.nfd__option_heading_subheading__left_top' ) + .invoke( 'text' ) + .should( 'contain', textValue ); };