So I'm using NX with Angular and I have multiple apps with two possible authentification methods. Therefore I need to have a E2E test, that tests both authentification methods, because they differ in input fields. So this would be my attempt but I don't know how i should import the environment variables:
describe('Login Page', () => {
it('Login should succeed', () => {
if (environment.authType === 'password') {
[...]
} else if (environment.authType === 'oauth') {
[...]
});
});
In my app I use dependency injection to access the environments, would it be possible to access them?:
import { environment } from '../environments/environment';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
AppRoutingModule,
],
providers: [
{ provide: 'environment', useValue: environment}
],
bootstrap: [AppComponent]
})
export class AppModule {}