Reputation: 95
I have a web part that uses the pageContext to get info about the page that the user is viewing. Until now I hve been available to test the webpart in my private environment by installing it in the app cataloge and then adding it to the page that I want get the info from. Now is time to test the app in the live environment but since it uses the pageContext it can not be tested in the workbench and I don't want to install it just for testing.
Is there a way to test this app in a similar way like using workbench? It is a Sharepoint online modern design environment.
Best regards Americo
Upvotes: 1
Views: 630
Reputation: 311
If you want to test SPFx projects with site contexts, pageContext
, access to lists, etc., the best option is the Hosted Workbench https://your-sharepoint-site-url/_layouts/workbench.aspx
(source @ Step #6). This should give you at least mockups of the page context, so you ensure all your page context calls are working.
Have you considered a site collection app catalog? If you perhaps have a private site collection on the live environment, the tenant admin can enable a site-collection-scoped app catalog, so anything you install there will not be visible to anyone else in your live environment.
Other than those, I do not believe there is any other way of testing an SPFx web part without uploading/installing the package.
Upvotes: 1