samedi 19 octobre 2019

Login tests - automation (node.js)

I was asked to complete the following login tests as part of a job application for the role of software tester: 

    const page = require ('../page/page')
const { expect } = require('chai')

const username = ""
const password = ""
const usernameField  = 'input[name=identifier]'
const passwordField ='input[name=password]'
const submitBtn = 'button'
const loginError = 'span=Username or Password are incorrect'

describe('login', () => {
    it('login with valid credentials', () => {
        browser.url('https://sso.hosteurope.de/')
        $(usernameField).isDisplayed()
        $(usernameField).setValue("test")
    })
    it('login with invalid credentials', () =>{
        browser.url('https://sso.hosteurope.de/')


        $(submitBtn).click()
        expect($(loginError).isDisplayed()).to.be.true
    })
})

According to the specifications, I will need an IDE, preferably VSCode, as well as installing Node JS to run the provided project. This should be done using Webdriver.io.

As you can probably tell, this is all foreign languages to me. I don't know JavaScript (but I am willing to learn), I recently completed a manual testing course, which I did confirm when applying for this job - as in, I told them that I do not know automation but that I am willing to learn. I did pass their first interview though, and now they asked me to complete 3 tests, the firsts of which is the above mentioned one. I do not want to cheat, I simply want to understand how this works. 

Help? 

Aucun commentaire:

Enregistrer un commentaire