Skip to content

Instantly share code, notes, and snippets.

Avatar

Shweta Sharma shwetaneelsharma

View GitHub Profile
@shwetaneelsharma
shwetaneelsharma / home_page_fail_test_chrome_only.spec.js
Last active Nov 9, 2020
Introduce CSS bugs through Cypress invoke command
View home_page_fail_test_chrome_only.spec.js
context('Validate Visual Difference in Home Page with Chrome Only', () => {
it('Validate Visual Difference in Home Page', () => {
cy.visit('/');
cy.get('.block-inner').should('be.visible');
// Change the CSS for creating visual bugs
cy.get('.field--name-field-content-link a').invoke('css', 'background-color', '#000000').should('have.css', 'background-color', 'rgb(0, 0, 0)')
cy.get('div.js-form-item').invoke('css', 'margin-left', '2rem').should('have.css', 'margin-left', '32px')*/
cy.eyesCheckWindow({
tag: "Home Page - Chrome",
target: 'window',
@shwetaneelsharma
shwetaneelsharma / gist:19c624f4a0ed1326b7d9041f974389c5
Created Oct 28, 2020
Applitools Cypress Ultrafast Grid configuration
View gist:19c624f4a0ed1326b7d9041f974389c5
if (Cypress.env('APPLITOOLS_SETUP')) {
beforeEach(() => {
cy.eyesOpen({
appName: 'Umami Drupal Site!',
batchName: 'Umami Drupal Site!',
browser: [
{ width: 1920, height: 1080, name: 'chrome' },
{ width: 1024, height: 768, name: 'firefox' },
{ width: 1440, height: 900, name: 'safari' },
{ width: 1200, height: 800, name: 'edgechromium' },
View gist:37f7c464e65caf0e0ff43c56f3a68cdc
context('Home Page', () => {
beforeEach(() => {
cy.visit('/');
});
it('Home Page test in English Languge!', () => {
cy.get('.block-inner').should('be.visible');
cy.eyesCheckWindow({
tag: "Home Page in English Languge",
target: 'window',
View create_topic_via_json_api
import {
BULK_TEST_TOPICS, BULK_TEST_TOPICS_NAMES, POST_RESPONSE_TWO_NOT_ONE, CREATED_TOPICS_URL
} from '../fixtures/topic_testdata'
import {
getfirstTopicTitle, getfirstTopicType
} from '../page-objects/create_topic'
describe('Topic Creation Via Json:API', function () {
View create_topic_via_ui.spec.js
import {
getfirstTopicTitle, getfirstTopicType, getTopicTitle, getTopicType, getSummaryTextFormat, getSourceBtnLocator, getCKEditorBodyLocator, getTopicDurationLocator, getTopicAudienceLocator, getTopicPublicityLocator, getTopicRecordingLinkURI,
clickBtnInsideCKEditorSummary, getSubmitButtonLocator, selectAuthor
} from '../page-objects/create_topic'
import {
CONTENT_URL, TOPIC_TYPE, TOPIC_BODY, TOPIC_TITLE, TOPIC_RECORDING_LINK, FORMAT_TYPE, TOPIC_DURATION, TOPIC_AUDIENCE, CSS_COLOR_PROPERTY, TOPIC_PUBLICITY_DEFAULT_CSS, SAVE_BTN_TEXT, CREATED_TOPICS_URL
} from '../fixtures/topic_testdata'
describe('Verify Topic End to End flow', function () {
View commands.js
/**
* Create a User through Drush
* @param {*} user - String
* @param {*} password - String
*/
Cypress.Commands.add('createUser', (user, pass, role) => {
let drush = 'lando drush';
cy.exec(`${drush} user-create "${user}" --mail="${user}@example.com" --password="${pass}"`,
//Code will continue to execute if the given user account data already exists