Skip to content

Instantly share code, notes, and snippets.

View shwetaneelsharma's full-sized avatar

Shweta Sharma shwetaneelsharma

View GitHub Profile
describe('Check for ally issues', ()=>{
it('report critical and serious ally issues', () => {
cy.visit('https://www.axelerant.com/quality-engineering-services')
cy.injectAxe()
cy.checkA11y(null, {
includedImpacts: ['critical', 'serious']
})
})
})
it('check a11y - login component', () => {
cy.log(
'Inject the axe-core library at runtime into the DOM of the selector under test',
);
cy.injectAxe();
cy.mount(<Login />);
cy.checkPageA11y('[role="main"]');
});
@shwetaneelsharma
shwetaneelsharma / home_page_fail_test_chrome_only.spec.js
Last active November 9, 2020 14:11
Introduce CSS bugs through Cypress invoke command
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 / create_topic_via_json_api
Last active November 4, 2020 14:40
create topic via JSON
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 () {
@shwetaneelsharma
shwetaneelsharma / gist:19c624f4a0ed1326b7d9041f974389c5
Created October 28, 2020 14:34
Applitools Cypress Ultrafast Grid configuration
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' },
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',
@shwetaneelsharma
shwetaneelsharma / create_topic_via_ui.spec.js
Created September 8, 2020 10:34
Create Topic CT via UI
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 () {
@shwetaneelsharma
shwetaneelsharma / commands.js
Last active September 1, 2020 12:33
Cypress blog
/**
* 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