What to practise

In VAF: AsUploadFileField().LetsUpload(path).

Tested in VAF-Demo

A test of this page from VAF-Demo: the whole VAF chain, from the page to the element, is in the test.

[Test]
public void OneFileIsReceived()
{
    string file = Path.Combine(TestContext.CurrentContext.WorkDirectory, "vaf-demo-upload.txt");
    File.WriteAllText(file, "Hello VAF");

    SharedContext.App.Should().HaveSection<UploadPage.Form>()
        .That.Should().HaveElement<UploadPage.Form.Single>()
            .That.AsUploadFileField().LetsUpload(file)
        .AndAlso().Should().HaveElement<UploadPage.Form.Upload>()
            .That.AsButton().LetsClick();

    SharedContext.App.Should().HaveSection<UploadPage.Result>()
        .That.Should().HaveElement<UploadPage.Result.First>()
            .That.AsLabelText().Should().HaveValue("vaf-demo-upload.txt — 9 bytes");
}

On GitHub (opens in a new tab)