package cz.moneta.test.smoke.itp.chrome;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.harness.annotations.JiraTestCase;
import cz.moneta.test.harness.annotations.NonConcurrentTestScenario;
import cz.moneta.test.harness.annotations.TestCase;
import cz.moneta.test.harness.support.auth.Credentials;
import cz.moneta.test.harness.support.auth.Key;

import static cz.moneta.test.harness.annotations.Environment.PPE;
import static cz.moneta.test.harness.annotations.Environment.TST1;
import static cz.moneta.test.harness.annotations.Environment.TST3;

@NonConcurrentTestScenario(name = "IB smoke test. Login to IB with mobile key.")
public class LoginToIbWithMobileKey {

    @TestCase(name = "Login into IB using Mobile Key", environments = {TST1, TST3, PPE})
    @JiraTestCase(id = "TEA-T19")
    void loginWithMobileKeySmokeTest(Harness harness, @Key("ib.client") Credentials client) {
        harness.withNewIb()
                .openLoginPage()
                .then(harness.tasks().newIb().loginWithUsernamePasswordAndDefaultMobKey(client.getUsername(), client.getPassword()))
                .checkUrl();
    }
}