text: var chars = 'abcdefghijklmnopqrstuvwxyz';
  var randomEmail = chars[Math.floor(Math.random() * 26)] + Math.random().toString(36).substring(2, 11) + '@domain.com';
  console.log("randomEmail    " + randomEmail);
  
  var randomEmail2 = chars[Math.floor(Math.random() * 26)] + Math.random().toString(36).substring(2, 11) + '@domain.com';
  console.log("randomEmail    " + randomEmail2);
  
  
  describe('Register new business user > Subscribe to a customer MA > Add user to your company ', () => {
      it('Register new business user > Subscribe to a customer MA > Add user to your company ', () => {
          cy.visit('https://preprod.ajprodukter.se//?auth_code=210603')
          cy.wait(2000)
  
  
          cy.get('[id="cookiebot-content-custom"]')
              .find('[onclick="allowAllAndSubmit()"]')
              .first()
              .click({ force: true })
          cy.wait(2000)
          console.log("Cookie accepted    ");
  
          cy.get('[data-test-id="open-login-button"]').click().wait(1000)
          cy.get('[href="/registrera-konto"]').first().click().wait(2000)
          console.log("Register form opened    ");
  
  
          cy.get('[type="text"]').click({ multiple: true }).first().type(randomEmail).wait(2000)
          console.log("randomEmail entered   " + randomEmail2);
  
          cy.get('[type="password"]').click().type('12345QWERTY').wait(2000)
          console.log("Password entered    ");
         
        
          cy.contains("Organisationsnummer*")
             .click({ force: true }).type('2222222222').wait(2000).type('enter')
          console.log("Org Number entered    ");
  
          cy.xpath('//*[@id="container"]/div/div[1]/main/div[2]/div[1]/div[2]/div[2]/form/div[3]/label/input')
              .click({ force: true }).type('Company Name').wait(2000).type('enter')
          console.log("Company Name entered    ");
  
          cy.get('[name="firstName"]').click().type('firstName').wait(2000)
          cy.get('[name="lastName"]').click().type('lastName').wait(2000)
          cy.get('[name="mobileNumber"]').click().type('0723333333').wait(2000)
          cy.get('[name="address"]').click().type('Bantorget 8').wait(2000)
          cy.get('[name="department"]').click().type('department').wait(2000)
          
          cy.get('[name="postalCode"]').click().type('22229').wait(2000)
          cy.get('[name="city"]').click().type('Lund').wait(2000)
          cy.get('[type="submit"]').click({ multiple: true }).wait(2000)
          console.log("Register form submitted    ");
  
          cy.get('[data-test-id="mypages-link"]',{ timeout: 100000 }).click()
          cy.contains('Inloggad som').should("be.visible", { timeout: 30000 })
  
        cy.get('[data-test-id="mypages-link"]', { timeout: 120000 })
        cy.xpath('//*[@id="container"]/div/div[6]/div[6]/div[2]/div/div/div/div[2]/a', { timeout: 120000 })
          .click()
          .wait(5000)
  
  
          //Subscribe to a new company
          cy.get('[href="/mina-sidor/multikonto"]').first().click().wait(2000)
        console.log("Opened multikonto tab on MyPages    ");
  
          cy.xpath('//*[@id="container"]/div/div[1]/main/div[2]/div[2]/div/div[2]/div/div/label/input', { timeout: 60000 })
              .click({ force: true })
              .type('2222222222').wait(2000)
          console.log("entered company number    ");
  
          cy.xpath('//*[@id="container"]/div/div[1]/main/div[2]/div[2]/div/div[2]/div/div/div/div[2]/button[1]', { timeout: 60000 })
              .click({ force: true })
          console.log("Submit Button clicked    ");
  
          cy.xpath('//*[@id="container"]/div/div[1]/main/div[2]/div[2]/div/div[2]/button', { timeout: 60000 })
              .click({ force: true })
          console.log("Submit Button clicked    ");
  
  
          cy.contains('Behandlas', { timeout: 60000 })
              .should("be.visible", { timeout: 60000 })
  
  
  
          //Add new user to your company
          cy.get('[href="/mina-sidor/anvandare"]').first().click().wait(2000)
          cy.xpath('//*[@id="container"]/div/div[1]/main/div[2]/div[2]/div[2]/div/div[1]/button', { timeout: 30000 })
              .click()
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/form/label[1]/input', { timeout: 30000 })
              .type(randomEmail2).wait(3000)
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/form/label[2]/input', { timeout: 30000 })
              .type("Name Anvandare").wait(3000)
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/form/label[3]/input', { timeout: 30000 })
              .type("Surname Anvandare").wait(3000)
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/form/label[4]/input', { timeout: 30000 })
              .type("0721111111").wait(3000)
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/form/button', { timeout: 200000 })
              .click().wait(20000)
  
          cy.xpath('//*[@id="container"]/div/div[6]/div[8]/div[2]/div/header/button', { timeout: 120000 }).click().wait(5000)
  
          cy.contains(randomEmail2).should("be.visible", { timeout: 150000 })
  
         
  
      })
  
  })
  