Excelizer e adições de funcionalidade ao simulator#1
Open
RotcivOcnarb wants to merge 3 commits into
Open
Conversation
added 3 commits
April 18, 2018 10:45
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Algumas alterações em funcionalidade ao simulator
Select
Agora alem das funções
simulator.click()esimulator.input(), foi criado uma funçãosimulator.selectt()que seleciona uma opção no select. Exemplo:await simulator.selectt('.default_select', {value: '19'}); //seleciona o option 19 do selectwaitForSelector
Também foi adicionado ao simulator a função
simulator.waitForSelector()que já existe no puppeteer para facilitar a espera de carregamento de componenteMensagens customizadas
Dentro das três funções,
simulator.click(),simulator.input()esimulator.selectt(), é possivel passar um parâmetro adicional nas opts, chamadomsg, onde é inserido um texto customizado, que irá ser recebido junto com os requests. Bastante útil para validação de SPA (Single Page Application) onde não há um registro de mudança de página muito visivel. Exemplo:await simulator.click('button.btn_main_red', { button: 'left', msg: "clicou no botao dos inputs" });Excelizer
O Excelizer é uma função que consegue gerar relatórios em excel com base na resposta dada pelo validator (um array de objetos). Para gerar o arquivo, use a função
excelizer(duration, results, req_params)ondereq_paramsé um objeto opcional para filtrar propriedades do objeto que são interessantes para sua validação. Exemplo:excelizer(duration, results);Faz o relatório de todos os parametros recebidos do requestexcelizer(duration, results, {dl: "", dp: "", ec: "", ea: "", el: ""});Coloca no relatório apenas os parametros de url, virtual pageview, event category, action e labelexcelizer(duration, results, {dl: "URL", dp: "Virtual Pageview", ec: "Category", ea: "Action", el: "Label"});Coloca no relatório apenas os parametros de url, virtual pageview, event category, action e label, com nomes customizados para facilitar a leituraExemplo de relatório gerado