Skip to content

Instantly share code, notes, and snippets.

// Instale essa biblioteca em seu projeto com o comando abaixo:
// npm install jwt-decode
// adicione essa linha no topo do arquivo sempre que precisar usar
import jwt_decode from "jwt-decode";
describe('Exemplo', () => {
it('Exemplo JWT Decode', () => {
@samlucax
samlucax / index.d.ts
Last active December 13, 2020 11:09
Cypress Commands Intellisense
/**
* Crie um arquivo index.d.ts na pasta support.
* Copie o conteúdo abaixo dentro do arquivo index.d.ts criado.
* Importante: esse NÃO substitui o index.js existente. Eles possuem finalidades diferentes.
*/
/// <reference types="cypress" />
declare namespace Cypress {
@samlucax
samlucax / index.js
Created November 18, 2020 13:44 — forked from r0nunes/index.js
Cypress: Running tests with multiple tags on grep
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
@samlucax
samlucax / workshop.yml
Created November 11, 2020 03:27
Workshop CWI YAML
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
# quando o pipeline deve ser executado?
trigger:
- main
# qual máquina o pipeline deve ser executado?
@samlucax
samlucax / cypress-schema.json
Created September 10, 2020 00:55
Cypress Schema
"$schema": "https://raw.githubusercontent.com/cypress-io/cypress/develop/cli/schema/cypress.schema.json"
@samlucax
samlucax / square.js
Created August 25, 2020 16:31
LongPress em um quadrado para validar se redimensiona - HammerJS
describe('LongPress no quadrado', () => {
it('LongPress no quadrado', () => {
// acessa o site codepen, para interação com o componente
cy.visit('https://codepen.io/choskim/pen/RLYebL');
// aguarda o frame com o componente ser renderizado (cypress-iframe)
cy.frameLoaded('#result')
// mapeia o elemento dentro de um iframe para a interação
cy.iframe('#result').find('div.square').as('square');
@samlucax
samlucax / main.yml
Last active June 27, 2021 18:27
Agilizei - Github Workflow criado na aula de Integração Contínua
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
pull_request:
@samlucax
samlucax / .gitignore
Created August 6, 2020 23:35
Semana Agilizei 1.0 - Git Ignore
# dependencias
node_modules/
# relatorios mocha
mochawesome-report
# relatorios cucumber
cypress/reports/index.html
cypress/reports/index.html.json
cypress/reports/cucumber-json/**
@samlucax
samlucax / reporter.js
Created August 6, 2020 04:49
Código do reporter construído na Semana Agilizei 1.0 - Aula 04 - Relatórios
const reporter = require('cucumber-html-reporter')
const options = {
theme: 'bootstrap',
jsonDir: 'cypress/reports/cucumber-json',
output: 'cypress/reports/cucumber_report.html',
reportSuiteAsScenarios: true,
scenarioTimestamp: true,
launchReport: true,
metadata: {
@samlucax
samlucax / javascript.json
Last active March 10, 2022 20:02
Meus Snippets do Visual Studio Code
{
"References Cypress": {
"prefix": "cyref",
"body": [
"/// <reference types=\"cypress\" />"
],
"description": "Adiciona autocomplete comandos Cypress"
}
}