Assert that the wiki held the upload back with a warning (or a part of it): the upload form came back under "Upload warning".
Examples
Then the upload should be held back with the warning "This file is a duplicate of the following file"
Then the upload should be held back with the warning "A file with this name exists already"
And the upload should be held back with the warning "duplicate"
Then the upload should be held back with the warning "This file is a duplicate of the following file: Test square.png"
Then the upload should be held back with the warning "Please modify the file description below and try again."
Pattern
Then(/^the upload should be held back with the warning "([^"]*)"$/, …)
Part of @webship-js/mediawiki-steps (github.com/webship/mediawiki-steps), a step pack for Webship-js 2.0.x.