这已经打了我几个小时了,是时候问了.
我在Visual Stutio中运行了Apps for Office教程,它运行正常 - 我可以在Excel中看到任务按钮和功能正常的任务窗格.
但是,我正在尝试将Apps for Office集成到我们现有的MVC项目中.全部出现,我可以在浏览器中看到Apps for Office页面,但Undefined is not a function在执行以下操作时,请访问以下Microsoft.Office.js模块代码window.external.GetContext():
OSF.InitializationHelper.prototype.getAppContext=function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
if (this._hostInfo.isRichClient) {
var returnedContext;
**var context=window.external.GetContext();**
var appType=context.GetAppType();
var appTypeSupported=false;
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我正在测试 keystonejs ( http://demo.keystonejs.com/ )的登录页面,但无法获得使用 cypress 成功的请求。没有 cypress 的登录请求具有以下请求标头:
而带有 cypress 测试的请求具有以下请求标头:
我能看到的唯一区别是 cookie 未在 cypress 测试请求中设置。正因为如此,请求得到 403。我实际上使用的是该服务器的本地版本,其中我将电子邮件/密码配置为图像中的那个。演示站点使用该页面中提供的不同集合。
测试很简单:
describe('The Keystone Admin UI Signin Page', function () {
before(function() {
cy.visit('http://localhost:3000/keystone/signin')
})
it('should signin successfully with valid email/password', function () {
cy.get('#signin-view input[name=email]').clear().type('user@test.e2e');
cy.get('#signin-view input[name=password]').clear().type('test');
cy.get('#signin-view button[type=submit]').click();
cy.get('#react-root').should('be.visible');
})
})
Run Code Online (Sandbox Code Playgroud)
无论如何要解决这个问题?