在index.html中,我正在尝试初始化firebase并将电子邮件发送到子模块app.html
<script>
const config = {
apiKey: "{{ firebase_api_key }}",
authDomain: "{{ firebase_auth_domain }}",
databaseURL: "{{ firebase_database_url }}",
storageBucket: "{{ firebase_storage_bucket }}"
};
firebase.initializeApp(config, 'dmc-db');
firebase.app('dmc-db').auth().signInWithCustomToken("{{custom_auth_token }}");
</script>
<body>
<dmc-app id="dmc-app" email="{{ email }}"></dmc-app>
</body>
在app.html中:
<script>
Polymer({
is: 'app',
properties: {
email: {
type: String,
observer: '_setUser',
}
},
_setUser: function (email, old) {
console.log('---- set user, email: ', email, ' old:', old);
},
</script>
问题是当cy.get('#create-button')找不到元素时,它将重试并触发polymer('_ setUser')中的观察者
beforeEach(() => {
cy.login();
cy.visit('/dashboard');
});
it('Should create work sheet without information', ()=> {
cy.get('#create-button');
})