Skip to content

Instantly share code, notes, and snippets.

@samlucax
samlucax / settings.json
Last active December 14, 2022 04:35
VSCode Settings
{
// Editor
"editor.parameterHints.enabled": false,
"editor.renderLineHighlight": "gutter",
"editor.tabSize": 2,
"editor.fontSize": 16,
"editor.lineHeight": 26,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.suggestSelection": "first",
@samlucax
samlucax / index.md
Last active February 9, 2024 06:09
Configurando o Mochawesome com o Cypress 10
@samlucax
samlucax / node.js.yml
Created March 18, 2021 06:38
Semana Agilizei 3.0 - Workflow desenvolvido para executar os testes
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
@samlucax
samlucax / utils.js
Created March 17, 2021 05:45
Semana Agilizei 3.0 - Arquivo de funções úteis
export const format = (value) => {
let formattedValue
formattedValue = value.replace(',', '.')
formattedValue = Number(formattedValue.split('$')[1].trim())
formattedValue = String(value).includes('-') ? -formattedValue : formattedValue
return formattedValue
}
// Cypress version: 6.5.0
context('Diego', () => {
beforeEach(() => {
// rota para os endpoints que trazem cada post
cy.intercept({
method: 'GET',
path: '/_next/data/**'
}).as('data')
/// <reference types="cypress" />
context('Portal', () => {
beforeEach(() => {
/**
Para autenticar no site são usados dois Cookies:
- OAuth_Token_Request_State
- JSESSIONID
@samlucax
samlucax / n1_rotas_com_mock.md
Last active July 15, 2021 17:23
N1 - Rotas com Mocks

Se você está usando o server & route

// rotas com mocks. 
// Necessário por enquanto, dado que a aplicação demoautomation está instável

cy.server()
cy.route({
  method: 'POST',
  url: '**/api/1/databases/userdetails/collections/newtable?**',
@samlucax
samlucax / index.js
Last active December 19, 2020 15:02
Adicionar imagens + vídeos no relatório do Mochawesome
// Adicionar este código dentro de support/index.js
// Importante: aplicável para projetos que usam o mochawesome como relatório
// No cypress.json, setar as seguintes configs:
// "screenshotsFolder": "mochawesome-report/assets",
// "videosFolder": "mochawesome-report/videos"
import './commands'
import addContext from 'mochawesome/addContext'
@samlucax
samlucax / main.yml
Created December 10, 2020 19:45
Semana Agilizei 2.0 - YAML
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
@samlucax
samlucax / vscode_prefs.json
Created December 7, 2020 23:14
Preferências do Visual Studio Code
{
// Define o tema do VSCode
"workbench.colorTheme": "Dracula",
//Aumenta a fonte do terminal
"terminal.integrated.fontSize": 22,
// Define o tema dos ícones na sidebar
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",