diff --git a/.gitignore b/.gitignore index 07f5cb96ec..fb612ab56b 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,7 @@ terraform.tfstate* output *.retry vault +js/fuw-* # docs docs/apidocs/phpdoc-cache-* diff --git a/docs/fuw/index.md b/docs/fuw/index.md index 5e83f93db7..6ecb95bf1d 100644 --- a/docs/fuw/index.md +++ b/docs/fuw/index.md @@ -38,6 +38,7 @@ $ docker-compose run --rm config $ docker-compose up -d gigadb $ docker-compose run --rm less $ docker-compose run --rm fuw-config +$ docker-compose run --rm js $ docker-compose up -d fuw $ docker-compose up -d web $ docker-compose exec web /usr/local/bin/enable_sites fuw-backend.dev.http @@ -66,6 +67,7 @@ Writing REMOTE_DOCKER_HOSTNAME to params-local as 'tcp://host.docker.internal:23 ``` $ docker-compose exec database bash -c 'psql -U gigadb < /docker-entrypoint-initdb.d/3-fuw.sql' $ docker-compose run --rm fuw-config +$ docker-compose run --rm js $ docker-compose run --rm fuw $ docker-compose exec web /usr/local/bin/enable_sites fuw-backend.dev.http ``` diff --git a/fuw/app/common/tests/_support/Step/Acceptance/AuthorSteps.php b/fuw/app/common/tests/_support/Step/Acceptance/AuthorSteps.php index aed2bf51ad..a4405da837 100644 --- a/fuw/app/common/tests/_support/Step/Acceptance/AuthorSteps.php +++ b/fuw/app/common/tests/_support/Step/Acceptance/AuthorSteps.php @@ -5,6 +5,8 @@ use League\Flysystem\Adapter\Local; use \backend\models\FiledropAccount; use \Facebook\WebDriver\WebDriverElement; +use \Behat\Gherkin\Node\TableNode; +use \Codeception\Util\ActionSequence; class AuthorSteps #extends \common\tests\AcceptanceTester { @@ -177,5 +179,31 @@ public function iShouldSeeTheFileUploadCompleted() }, 30); } + /** + * @Given I have uploaded files for dataset + */ + public function iHaveUploadedFilesForDataset(TableNode $files) + { + // Database record + foreach ($files->getRows() as $index => $row) { + if ($index === 0) { // first row to define fields + $keys = $row; + continue; + } + $this->I->performInDatabase('fuwdb', ActionSequence::build()->haveInDatabase('upload', array_combine($keys, $row)) + ); + } + + } + + /** + * @Then I should see list of files + */ + public function iShouldSeeListOfFiles() + { + throw new \Codeception\Exception\Incomplete("Step `I should see list of files` is not defined"); + } + + } \ No newline at end of file diff --git a/fuw/app/common/tests/acceptance/file-upload-2-author-upload.feature b/fuw/app/common/tests/acceptance/file-upload-2-author-upload.feature index 4e546396d8..febf487d86 100644 --- a/fuw/app/common/tests/acceptance/file-upload-2-author-upload.feature +++ b/fuw/app/common/tests/acceptance/file-upload-2-author-upload.feature @@ -36,7 +36,7 @@ Scenario: Pressing the upload button bring up File Upload Wizard upload screen And the "Your Uploaded Datasets" tab is active When I press "Upload Dataset Files" Then I should be on "/authorisedDataset/uploadFiles/" - And I should see "File Uploader for dataset 100007" + And I should see "Uploading files for the dataset 100007" And I should see "Drop files here, paste or browse" @ok @file-upload @@ -75,6 +75,22 @@ Scenario: Queued files are all uploaded And I wait "1" seconds Then I should see the file upload completed +@wip +Scenario: Next button to proceed to file metadata annotation form + Given I sign in as the user "Artie" "Dodger" + And I am on "/authorisedDataset/uploadFiles/" + And I have uploaded files for dataset + | doi | name | size | location | extension | status| + | 100007| TheProof.csv | 112 | ftp://foobar | csv | 1 | + | 100007| TheProof2.csv| 112 | ftp://foobar | csv | 1 | + When I press "Next" + Then I should be on "/authorisedDataset/annotateFiles/" + And I should see list of files + | doi | name | size | location | extension | status| + | 100007| TheProof.csv | 112 | ftp://foobar | csv | 1 | + | 100007| TheProof2.csv| 112 | ftp://foobar | csv | 1 | + And I should see a "Previous" link + # Scenario: There's no button for uploading files if dataset doesn't have the right status # Given I sign in as a user # And I am on "/user/view_profile#submitted" diff --git a/protected/views/authorisedDataset/filesUpload.php b/protected/views/authorisedDataset/filesUpload.php index 9c2a21ddd7..613be69e59 100644 --- a/protected/views/authorisedDataset/filesUpload.php +++ b/protected/views/authorisedDataset/filesUpload.php @@ -1,62 +1,58 @@ -
-

{{ message}} for dataset {{ doi }}

-
- -
-
- \ No newline at end of file + }); + + +
+ \ No newline at end of file diff --git a/protected/views/layouts/uploader_layout.php b/protected/views/layouts/uploader_layout.php index 375be14e86..388e79e29c 100644 --- a/protected/views/layouts/uploader_layout.php +++ b/protected/views/layouts/uploader_layout.php @@ -6,6 +6,7 @@ +clientScript->registerScriptFile('/js/fuw-1.0.0.js', CClientScript::POS_END); ?>