Closed plocket closed 2 months ago
Another idea to add to the mix: Allow downloading multiple docs in one step - loop through the docs one by one, setting the custom timeout for each one so that, like story table rows, they each get the developer-defined amount of time to download. [We'd match however many links we could. Would that work for 'View' buttons, or would they error because nothing got downloaded? Should the download step error if nothing gets downloaded?]
~For documents that have the same name [(on the same page?)], maybe we could just detect that number in each of them and only download one file per each unique number. I wonder if our code is already able to download 'View' files. Would be good to test.~
[We've decided interview dev need to give files unique names. That's a good practice anyway.]
The download step uses the given string to find an href that contains the given string in it. In the AL interviews, almost all current interviews have a table with a 'View' button, a 'Download' button, and a 'Download zip' button. Examples of
href
s:The numbers in there are different each time you run the interview. For the current download step you'd only be able to use 'pdf_doc_1.pdf' to identify the link and both the 'View' and 'Download' buttons would look the same.
I believe the difference we see with with the download file (
uploadedfiledownload
) is the use ofattachment=True
when calling theurl_for()
method of a document to create those links in the buttons.Also, when writing tests for the ALDocument classes, I ended up showing the same document on the page multiple times. Are there reasons a regular developer may do the same? A file with the same href ending on the same page? That doesn't mean the documents would be the same, just that the filenames would be the same. Would they have the same text surrounding them too?
Options I can think of in some combination:
attachment=True
and then search for something that containsuploadedfiledownload
and the given string.None of these really seem sufficient. The most flexible one is ordinals, but that's also pretty fragile and, when code did change and tests failed, it would be hard to figure out why.
attachments:
], especially when files of the same name are included in the list of attachments.