This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const playwright = require('playwright'); | |
const PAGE_URL = "https://www.eliostruyf.com"; | |
describe(`UI Tests with Playwright`, () => { | |
let browser = null; | |
let page = null; | |
/** | |
* Create the browser and page context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cypress.Commands.add('spAuth', function () { | |
const options = { | |
username: Cypress.env('username'), | |
password: Cypress.env('password'), | |
pageUrl: Cypress.env('appUrl') | |
} | |
cy.task('SharePointLogin', options).then(result => { | |
cy.clearCookies(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const layoutContent = data.LayoutWebpartsContent; | |
const el = document.createElement('div'); | |
el.innerHTML = layoutContent; | |
const divElm = el.querySelectorAll("[data-sp-canvascontrol]"); | |
if (divElm && divElm.length > 0) { | |
const cntlData = divElm[0].getAttribute("data-sp-controldata"); | |
if (cntlData) { | |
const pCtrlData = JSON.parse(cntlData); | |
if (pCtrlData && pCtrlData.properties) { | |
const focalData = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const layoutContent = data.LayoutWebpartsContent; | |
const el = document.createElement('div'); | |
el.innerHTML = layoutContent; | |
const divElm = el.querySelectorAll("[data-sp-canvascontrol]"); | |
if (divElm && divElm.length > 0) { | |
const cntlData = divElm[0].getAttribute("data-sp-controldata"); | |
if (cntlData) { | |
const pCtrlData = JSON.parse(cntlData); | |
if (pCtrlData && pCtrlData.properties) { | |
const focalData = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "cbe7b0a9-3504-44dd-a3a3-0e5cacd07788", | |
"instanceId": "cbe7b0a9-3504-44dd-a3a3-0e5cacd07788", | |
"title": "\r\n Title area\r\n ", | |
"description": "\r\n Title area description\r\n ", | |
"serverProcessedContent": { | |
"htmlStrings": {}, | |
"searchablePlainTexts": {}, | |
"imageSources": { | |
"imageSource": "/sites/ECS2019/Shared Documents/brickheadz/boy1_b69dc338cfc310850f0459400b66b5d8.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { override } from '@microsoft/decorators'; | |
import { BaseApplicationCustomizer } from '@microsoft/sp-application-base'; | |
import { SPEventArgs, Guid } from '@microsoft/sp-core-library'; | |
import { SPHttpClient } from '@microsoft/sp-http'; | |
import { cloneDeep } from '@microsoft/sp-lodash-subset'; | |
interface NavigationEventDetails extends Window { | |
isNavigatedEventSubscribed: boolean; | |
currentPage: string; | |
currentHubSiteId: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bind the control to the browser history to do metadata check when page is in edit mode | |
*/ | |
private bindToHistory(): void { | |
// Only need to bind the pushState once to the history | |
if (!this.pushState) { | |
// Binding to page mode changes | |
this.pushState = () => { | |
const defaultPushState = history.pushState; | |
// We need the current this context to update the component its state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { override } from '@microsoft/decorators'; | |
import { BaseApplicationCustomizer } from '@microsoft/sp-application-base'; | |
import { SPEventArgs } from '@microsoft/sp-core-library'; | |
interface NavigationEventDetails extends Window { | |
isNavigatedEventSubscribed: boolean; | |
currentPage: string; | |
currentHubSiteId: string; | |
currentUICultureName: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as strings from 'LibraryStrings'; | |
import { LocaleKeys } from './loc/LocaleKeys'; | |
export class LocalizationLibrary { | |
/** | |
* Retrieve the locale label for the specified key | |
* | |
* @param localeKey | |
*/ |