Skip to content

Instantly share code, notes, and snippets.

View csouchet's full-sized avatar
🦤

Souchet Céline csouchet

🦤
  • Bonitasoft
  • Grenoble, France
  • 13:19 (UTC +02:00)
  • X @CelineS
View GitHub Profile
@csouchet
csouchet / github-conventional-comments.js
Last active November 24, 2023 08:51 — forked from ifyoumakeit/github-conventional-comments.js
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const COMMENTS = [
["🙌 praise", "Praises highlight something positive. Try to leave at least one of these comments per review. Do not leave false praise (which can actually be damaging). Do look for something to sincerely praise."],
["🧐 nitpick", "Nitpicks are trivial preference-based requests. These should be non-blocking by nature."],
["🚀 suggestion", "Suggestions propose improvements to the current subject. It's important to be explicit and clear on what is being suggested and why it is an improvement. Consider using patches and the blocking or non-blocking decorations to further communicate your intent."],
["🛠️ issue", "Issues highlight specific problems with the subject under review. These problems can be user-facing or behind the scenes. It is strongly recommended to pair this comment with a suggestion. If you are not sure if a problem exists or not, consider leaving a question."],
["📌 todo",
@csouchet
csouchet / Shiny App.R
Created October 14, 2021 09:59
'Using BPMN Visualization in R' article
# Install and load packages
> install.packages("shiny")
> library(shiny)
> devtools::install_github("process-analytics/bpmn-visualization-R")
> library(bpmnVisualization)
> displayBpmn <- function() {
bpmn_file <- system.file("examples/Travel_Booking.bpmn", package = "bpmnVisualization")
overlays <- list(bpmnVisualization::create_overlay("_6–203", "9"))
bpmnVisualization::display(bpmn_file, overlays)
}
@csouchet
csouchet / Display diagram with overlays.R
Created October 14, 2021 09:58
'Using BPMN Visualization in R' article
> overlays <- list(bpmnVisualization::create_overlay("bpmn_element_id_1", "42"), bpmnVisualization::create_overlay("bpmn_element_id_2", "9"))
> bpmnVisualization::display(bpmn_file, overlays)
@csouchet
csouchet / Display diagram.R
Created October 14, 2021 09:58
'Using BPMN Visualization in R' article
> bpmnVisualization::display(bpmn_file)
@csouchet
csouchet / Load BPMN file.R
Created October 14, 2021 09:57
'Using BPMN Visualization in R' article
> bpmn_file <- system.file("examples/Email_Voting.bpmn", package = "bpmnVisualization")
@csouchet
csouchet / Installation.R
Last active October 14, 2021 09:59
'Using BPMN Visualization in R' article
> devtools::install_github("process-analytics/bpmn-visualization-R")
> library(bpmnVisualization)
@csouchet
csouchet / diagram.rendering.test.ts
Created April 27, 2021 14:35
Reuse the snapshots with Jest-image-snapshot 2
import { getConfig } from './helpers/image-snapshot-config';
function async gotoPageWithBPMNContainer(margin: number): Promise<ElementHandle<Element>> {
// Redirect the current page in the browser to a new url with Playwright
const response = await page.goto('http://localhost:10002/rendering-diagram.html?bpmn=./gateways.bpmn&fitMargin=${margin}');
// Be sure the page is displayed correctly with Playwright & Jest
expect(response.status()).toBe(200);
await expect(page.title()).resolves.toMatch('BPMN Visualization - Diagram Rendering' );
return await page.waitForSelector('#bpmn-container', { timeout: 5_000 });
@csouchet
csouchet / image-snapshot-config.ts
Created April 27, 2021 14:31
Reuse the snapshots with Jest-image-snapshot 1
// jest-image-snapshot custom configuration
export function getConfig (customSnapshotIdentifier: string, customDiffDir: string) {
return {
// …,
customSnapshotIdentifier,
customDiffDir
};
}
// …
@csouchet
csouchet / bpmn.navigation.test.ts
Created April 27, 2021 14:27
Order the snapshots with Jest-image-snapshot 3
import { gotoPageWithBPMNContainer, getConfig } from './helpers/image-snapshot-config';
it(`no visual regression for drag & drop with the mouse of the BPMN content in the container`, async () => {
const bpmnContainerElement = await gotoPageWithBPMNContainer();
const bounding_box = await bpmnContainerElement.boundingBox();
// Move the mouse pointer to the center of the BPMN Container
const containerCenterX = bounding_box.x + bounding_box.width / 2;
const containerCenterY = bounding_box.y + bounding_box.height / 2;
await page.mouse.move(containerCenterX, containerCenterY);
@csouchet
csouchet / bpmn.rendering.test.ts
Created April 27, 2021 14:25
Order the snapshots with Jest-image-snapshot 2
import { gotoPageWithBPMNContainer, getConfig } from './helpers/image-snapshot-config';
it(`no BPMN Gateway visual regression`, async () => {
await gotoPageWithBPMNContainer();
// Take the screenshot of the page with Playwright
const image = await page.screenshot({ fullPage: true });
// Compare the taken screenshot with the baseline screenshot (if exists), or create it (else)
const config = getConfig('__image_snapshots__/bpmn');