英文:
How to create a bookmark for a url and reopen the bookmark in chrome using TestCafe automation
问题
我需要收藏我的报告网址,然后更改用户权限,不允许查看报告。如果同一用户尝试打开保存的书签网址,应禁止访问。我只需要在Angular 15中使用TestCafe自动化程序如何收藏网址并重新打开它的帮助。示例书签网址:
> https://localhost:4200/cc/dashboard/8155fc36-1111-4ad4-ab11-1331e756ef33/view
英文:
I have a scenario where I need to bookmark my report url and then changed the user permission to not to allow to view the report. If the same user try to open the saved bookmark url he should not be allowed. I just need help in how to bookmark a url and reopen it back using testcafe automation in Angular15. Example URL to bookMark.
> https://localhost:4200/cc/dashboard/8155fc36-1111-4ad4-ab11-1331e756ef33/view
答案1
得分: 0
TestCafe是用于网站的端到端测试解决方案。就我了解,您想要操作浏览器界面。在TestCafe中无法这样做。
据我所知,将任何URL添加到书签并从书签中打开此URL不会影响您网站的行为。如果您只想从测试中获取报告的URL,您可以使用eval
方法:
const location = await t.eval(() => window.location);
然后,您可以在任何地方使用接收到的URL,包括在更改角色后导航到此URL。
英文:
TestCafe is an end-to-end testing solution for websites. As far as I understand, you want to manipulate the browser interface. It's not possible to do so in TestCafe.
As far as I know, adding any URL to bookmarks and opening this URL from bookmarks won't affect your site's behavior. If you just want to get the report URL from the test, you can use the eval
method:
const location = await t.eval(() => window.location);
Then, you can use the received URL anywhere, including navigation to this URL after changing the role.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论