testingisdocumenting/webtau

Persona switch does not honor config values

tsiq-clemens opened this issue · 11 comments

After upgrading from 1.40 to 1.43.1, the persona config values no longer override the default config.
E.g. with this configuration, my tests do switch between personas, i.e. currentPersona.id.should == "altTenant" passes, but the tenantId value is still 770.

tenantId = 111

personas {
    mainTenant {
        /* same as default persona, but an explicit Persona is used for clarity in MT tests */
        tenantId = 111
    }
    altTenant {
        tenantId = 222
    }
}

Oh no! Sorry about that.
many chance you can add a e2e feature test to replicate so then I can jump on and add a fix?

working on it...

getting stuck compiling webtau for some reason, but this is the test I have in mind:

scenario('context example') {
    cfg.email.should == "default@email.send"
    Alice {
       step("do something in context of Alice") {
           customAction()
           cfg.email.should == "alice@email.send"
       }
    }

    Bob {
        step("do same thing in context of Bob") {
            customAction()
            cfg.email.should == "bob@email.send"
        }
    }
}

did you figure out build issue?

added PR #1003, test passes. Feel free to add more logic to the PR

still sorting it out. webtau-cli-testing is unhappy. Might be related to my OS upgrade where openjdk-8 disappeared

Finally getting there. Had to update Firefox, set some default JDK's, etc.
The test above passes for me as well, which is great, but I'm puzzled now why that is not working in my actual environment.
With v1.40 I have no trouble. Any inspirations?

Could you print the values in your setup?
Debugging stand-alone test script from IDE could reveal some cfg internal issue as well

I'll give it a go when I get a sec, might be tomorrow

any luck here?