I'm new to Cypress, and i'm facing issues trying to upload a file.
I have a form which looks like this,
It will open a window form to select files to Upload.
So, How to I select a file and upload with this window form ?
I tried following the steps in the git issue but could get it to work.
I was looking into having the files stored in fixtures to allow easier access. (but not sure if this is correct)
Any help would be great
Thanks
This is not yet implemented, see this open issue: issue link.
There are however some hacky ways around that, and some third party packages that might help: cypress upload
Related
I create an HTML document using Sphinx. When I click on the index.html file it opens a browser and looks like this. The look depends on some .CSS and .JS files being executed:
If I open the same file from the JupyterLab file browser, it opens in a tab but looks much worse: .CSS and .JS are not displayed, and images are not displayed. It looks like this:
Is there a way to get JupyterLab to get JupyterLab to execute the .CSS and .JS and pass through any images linked in the text? The JupyterLab is running on a remote server, so I don't have the option of having it create a new browser process on my local machine, because the files are remote.
Using JupyterLab within JupyterHub (old school install with conda, no docker and such)
I've been stuck at this HTML Preview issue for a few weeks.
I have the very same use case as you (Sphinx stuff for a team to work on their docs).
So far, no luck.
It may or may not work (depending on... I'm not sure of...) if I'm using JupyterLab from the browser on the hypervisor hosting JupyterHub itself
It won't work if I'm using JupyterLab from the browser on my client machine.
I tried to mess around with
c.NotebookApp.allow_remote_access = True parameter with no luck
tried to put it in my profile ~/.jupyter/jupyter_notebook_config.py
tried to add it to general config file /path/to/conf/jupyterhub_config.py
=> Not sure of the right way to set this option on JupyterLab's JupyterHub install, nor if it's even a relevant option...
Well, security wise, it's not, that's a given (^^'), but Preview HTML is an important feature for Sphinx users, hope someone can help with this...
I also looked after nginx config, but you get the issue with or without the reverse proxy anyway...
In a web application I am working on I would like to be able to download files, modify them localy and reupload them to the server.
To make it as easy as possible for the users, I would like them to choose the download location and use a single button to upload the changes afterwards.
My current apporach is the following:
Use window.showSaveFilePicker to choose location and get a FileSystemFileHandle
Download the content and write it to the FileSystemFileHandle
Show a button which allows to upload the changes using FileSystemFileHandle#getFile to get the modified content.
This approach works pretty well but the user has to manually search and open the file after the download and I would like to support them in this step and make it as simple as possible.
Ideally the file should automatically be opened with the default application after the download but I couldn't find a way to do that.
One idea was to open the file in a new tab using the file://-URL, allowing the browser to decide what to do but the FileSystemFileHandle does not seem to expose the absoulte path.
Is there any way to open the downloaded file with the default application? If not, what other possibilities are there to make the mentioned use case as simple as possible?
Thanks in advance
EDIT:
I found that you can open certain applications using special urls like ms-excel:ofe|u|file://path/to/file.xls.
This would be enough for most use cases but for this to work I would need to get the file url from a FileSystemFileHandle.
For security reasons, there is no way for a Web app to open local apps. In the future, though, once file change events are implemented, you can await changes to the file, and then re-open it. This should solve your use case.
I am using 'selenium-webdriver' npm package to simulate an endpoint user - I click on buttons, select drop-downs and checkboxes.
I come across an image that will help me download a PDF file.
So what I want and what happens when I manually click on this image button on a regular chrome tab is that it will prompt a save-window:
What actually happens is that the file is downloaded automatically in the default directory (which is 'download' folder for me), without showing the save-window prompt. If the same file is already present in the download folder, then the new file gets a suffix of "(2)" or a corresponding number to its name.
I generally use this basic Selenium documentation: https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/
2nd reference I use is: Selenium-javascript-docs
Most of the Selenium question-answers are in the java language, so those don't help me as I'm using the javascript package.
I do know it has to do with the chrome options, or a chrome-specific field, but the document is just lacking. I came across the chrome-driver doc, but it is not javascript-friendly.
Other than disabling the automatic-download feature, I am also interested in changing the download directory to a custom location.
Any help or reference/guide/documentation source is greatly appreciated. Thank you in advance and thank you for reading.
You can use setDownloadPath to modify the path where the file will be downloaded.
Other than that, I don't think there's an option to prevent the automatic download
im trying to change some behavior of a webpage. The page is built using SMARTY so the file that won't update is a .tpl file. Containing mostly JavaScript. The whole thing is weird because on my local drive (IDE) the file is the way i want it to be, it is the correct version on the server when i check it with SFTP.
BUT if i open the page with a browser, even a newly installed one, the code inside that page is the old version.
Now i can't send any error because there obviously is none.
So im lookin at a problem i can't fix or even begin to untangle.
I tried following things:
Restarting apache2
Deleting the file and uploading the correct version (here i might add the site broke when i deleted it and tried to view it)
This has been bugging me for a long time so it seems time couldn't fix it either.
I hope somebody has any idea to why this is happening!
Thanks
Clear (delete all cache files) smarty cache!
More details about cache dir: https://www.smarty.net/docs/en/api.set.compile.dir.tpl
My goal is to allow the user to upload a pdf from their file explorer, and upon clicking a button that says 'view', they'll be able to see that PDF file.
I'm currently using react-file-picker to upload files, but that doesn't seem to work.
I know someone is going to comment, "Look it up", or something like that, but I have. All the examples that I've seen so far are only tailored to PDFs that can be found at various online URLs. I'm obviously not using URLs, but instead actual pdfs from the users file explorer.
Currently I have a method for displaying the actual button to use when uploading files, and there's a method attached to it that handles the file after it's uploaded. I need help with the handleFileChange method below so that I can show the pdf. If 'FilePicker' isn't a good option, can anyone provide me with suggestions on good React tools that will help me achieve this?
Thanks for your help!
My code for uploading a file:
Check out the documentation for pdf-viewer-reactjs. It will do what you need and looks to be simple to implement.