Skip to content

Commit

Permalink
Merge pull request #119 from lilt/3.x-cover-download-diagnostic-data
Browse files Browse the repository at this point in the history
Cover download job diagnostic data
  • Loading branch information
hadomskyi authored Sep 4, 2023
2 parents b8f1190 + 1205629 commit e3c2b44
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ test-craft-versions: prepare-container
"./craft-versions.sh ${CRAFT_VERSION}"

require-guzzle-v6:
docker-compose exec -T -u www-data cli-app sh -c "php composer.phar require guzzlehttp/guzzle:^6.0 --no-warnings -W"
docker-compose exec -T -u www-data cli-app sh -c "php composer.phar require guzzlehttp/guzzle:^6.0 -W --no-scripts || true"
docker-compose exec -T -u www-data cli-app sh -c 'if ! php composer.phar show -i | grep "guzzlehttp/guzzle" | grep "6."; then echo "Guzzle version 6 is not present."; exit 1; fi'
17 changes: 15 additions & 2 deletions e2e/cypress/e2e/jobs/copy-source-text-flow/filters.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ describe(
cy.get('.data').find('tr td[data-attr="status"]').should('have.length', 1)
})

it(
'can see job in the list with status filter', async () => {
it('can see job in the list with status filter',() => {
const appUrl = Cypress.env('APP_URL');
cy.visit(`${appUrl}/admin/craft-lilt-plugin/jobs`)

Expand All @@ -124,4 +123,18 @@ describe(
invoke('attr','data-status').
should('equal', 'ready-for-review')
})

it('can download job diagnostic data', () => {
cy.openJob(jobTitle);

cy.get('#lilt-download-diagnostic-data').click();
cy.wait(5000);

cy.exec('ls cypress/downloads').then((result) => {
const files = result.stdout.split('\n');

const zipFiles = files.filter(file => file.endsWith('.zip'));
expect(zipFiles).to.have.length.greaterThan(0);
});
})
});
2 changes: 1 addition & 1 deletion src/templates/_components/job/_settings.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
{% endif %}

<div class="field" style="padding: 14px 24px">
<a style="color: grey; text-align: center;width: 100%;" href="{{ url('craft-lilt-plugin/report/data/' ~ element.id) }}">Download Diagnostic Data</a>
<a id="lilt-download-diagnostic-data" target="_blank" style="color: grey; text-align: center;width: 100%;" href="{{ url('craft-lilt-plugin/report/data/' ~ element.id) }}">Download Diagnostic Data</a>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion src/templates/_components/utilities/configuration.twig
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div class="utility-status"></div>
</div>

<a style="color: grey" href="{{ url('admin/craft-lilt-plugin/report/data') }}">Download Diagnostic Data</a>
<a id="lilt-download-diagnostic-data" target="_blank" style="color: grey" href="{{ url('admin/craft-lilt-plugin/report/data') }}">Download Diagnostic Data</a>

</form>
</div>

0 comments on commit e3c2b44

Please sign in to comment.