Skip to content

Instantly share code, notes, and snippets.

*** Settings ***
Library SeleniumLibrary
Library EyesLibrary
*** Test Cases ***
Check The Main Demo Page
Open Browser https://applitools.github.io/demo Chrome
Click Link ?diff
Eyes Open
Eyes Check Window DemoApp Main Page Fully
rem Install Robot Framework, Selenium, EyesLibrary packages and dependencies
pip install robotframework robotframework-seleniumlibrary eyes-robotframework
rem Run EyesLibrary initialization script
python -m EyesLibrary init-config
rem Set APPLITOOLS_API_KEY environment variable
set /p APPLITOOLS_API_KEY="Enter your Applitools API Key: "
#!/bin/sh
# Run this script to install and initialize the library and then set your API key
# Install Robot Framework, Selenium, EyesLibrary packages and dependencies
pip install robotframework robotframework-seleniumlibrary eyes-robotframework
# Run EyesLibrary initialization script
python -m EyesLibrary init-config
# Set APPLITOOLS_API_KEY environment variable
*** Settings ***
Library SeleniumLibrary
Library EyesLibrary
*** Variables ***
${clickDiffLink}= ${False}
*** Test Cases ***
Compare The Random Number Sentence
Open Browser https://applitools.github.io/demo Chrome
*** Settings ***
Library SeleniumLibrary
Library EyesLibrary
*** Variables ***
${useCheckWindow}= ${True}
*** Test Cases ***
Compare Eyes Check Window versus Eyes Check
Open Browser https://applitools.github.io/demo Chrome
*** Settings ***
Library SeleniumLibrary
Library EyesLibrary
*** Test Cases ***
Check the Login page
Open Browser https://applitools.github.io/demo Chrome
Eyes Open
Eyes Check Window DemoApp Login Fully
Eyes Close Async
it("Verify jsonLD structured data - simple", () => {
// Query the script tag with type application/ld+json
cy.get("script[type='application/ld+json']").then((scriptTag) => {
// we need to parse the JSON-LD from text to a JSON to easily test it
const jsonLD = JSON.parse(scriptTag.text());
// once parsed we can easily test for different data points
expect(jsonLD["@context"]).equal("https://schema.org");
expect(jsonLD.author).length(2);
it("Verify page description", () => {
cy.get('meta[name="description"]').should(
"have.attr",
"content",
"Testing SEO data using automation."
);
});
it("Verify page title", () => {
cy.title().should("eq", "Automated Testing for SEO | Regression");
});
<!DOCTYPE html>
<html>
<body>
<head>
<title>Automated Testing for SEO | Regression</title>
<meta name="description" content="Testing SEO data using automation.">
<script type="application/ld+json">
{