Answers for "pulando deleta candidato"

0

pulando deleta candidato

/// <reference types="cypress"/>
import function_global from "../../../../utilitys/functions-globais";
const get_curriculos = require("./request");

describe.skip("logar via front e deleta curriculo via serviço", () => {
 
  beforeEach(() => {
    function_global.verifica_se_usuario_esta_logado("rodrigo_cunha");
  });


  
  // it('so logando',()=>{
  //   cy.visit('https://mgpt-front-api.dev.sicredi.cloud/mgpt/') 
 
  // })

  // it('so acessando a url',()=>{
  //   cy.visit('https://mgpt-front-api.dev.sicredi.cloud/mgpt/') 
 
  // }) 

  it("deletar curriculo via serviço",  () => {
    var candidato;
   cy.request({
      method: "GET",
      url: Cypress.env('URL_GET_CURRICULOS'),          
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem("id_token")}`,
      },
    })
      .then((response) => {
        expect(response.status).to.equal(200);
        candidato = response.body.results[0].idCandidato;
      })
      .then(() => {
        cy.request({
          method: "DELETE",
          url: `${Cypress.env("URL_GET_CURRICULOS")}${candidato}`,
          headers: {
            Authorization: `Bearer ${sessionStorage.getItem("id_token")}`,
          },
        })
          .then((response) => {
            expect(response.status).to.equal(200);
          })
          .then(() => {
            cy.request({
              method: "GET",
              url: Cypress.env("URL_GET_CURRICULOS_GSO"),
              headers: {
                Authorization: `Bearer ${sessionStorage.getItem("id_token")}`,
              },
            }).then((response) => {
              const id_candidato_pos_nova_consulta =
                response.body.results[0].idCandidato;
              expect(response.status).to.equal(200);
              expect(candidato).not.to.equal(id_candidato_pos_nova_consulta);
            });
          });
      });
  });
});
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language