diff --git a/src.compiler/csharp/CSharpAstTransformer.ts b/src.compiler/csharp/CSharpAstTransformer.ts index c79c6095a..0b130b349 100644 --- a/src.compiler/csharp/CSharpAstTransformer.ts +++ b/src.compiler/csharp/CSharpAstTransformer.ts @@ -495,6 +495,8 @@ export default class CSharpAstTransformer { } } else if (ts.isVariableStatement(s)) { this.visitTestClassProperty(csClass, s); + } else if (ts.isFunctionDeclaration(s)) { + this.visitTestClassMethod(csClass, s); } else { this._context.addTsNodeDiagnostics( s, @@ -507,6 +509,40 @@ export default class CSharpAstTransformer { this._csharpFile.namespace.declarations.push(csClass); } + private visitTestClassMethod(parent: cs.ClassDeclaration, d: ts.FunctionDeclaration) { + const signature = this._context.typeChecker.getSignatureFromDeclaration(d); + const returnType = this._context.typeChecker.getReturnTypeOfSignature(signature!); + + const csMethod: cs.MethodDeclaration = { + parent: parent, + nodeType: cs.SyntaxKind.MethodDeclaration, + isAbstract: false, + isOverride: false, + isStatic: false, + isVirtual: false, + name: this._context.toPascalCase((d.name as ts.Identifier).text), + parameters: [], + returnType: this.createUnresolvedTypeNode(null, d.type ?? d, returnType), + visibility: this.mapVisibility(d.modifiers), + tsNode: d, + skipEmit: this.shouldSkip(d) + }; + csMethod.isAsync = + !!d.modifiers && + !!d.modifiers.find(m => m.kind === ts.SyntaxKind.AsyncKeyword); + + const type = this._context.typeChecker.getTypeAtLocation(d.name!); + csMethod.returnType.parent = csMethod; + + d.parameters.forEach(p => csMethod.parameters.push(this.makeParameter(csMethod, p))); + this._declarationOrAssignmentTypeStack.push(type); + csMethod.body = this.visitBlock(csMethod, d.body as ts.Block); + this._declarationOrAssignmentTypeStack.pop(); + + parent.members.push(csMethod); + this._context.registerSymbol(csMethod); + } + private visitTestMethod(parent: cs.ClassDeclaration, d: ts.CallExpression) { const csMethod: cs.MethodDeclaration = { parent: parent, diff --git a/test-data/visual-tests/features/effects-and-annotations/bends.gp b/test-data/visual-tests/effects-and-annotations/bends.gp similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/bends.gp rename to test-data/visual-tests/effects-and-annotations/bends.gp diff --git a/test-data/visual-tests/features/effects-and-annotations/bends.png b/test-data/visual-tests/effects-and-annotations/bends.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/bends.png rename to test-data/visual-tests/effects-and-annotations/bends.png diff --git a/test-data/visual-tests/features/effects-and-annotations/brush.gp5 b/test-data/visual-tests/effects-and-annotations/brush.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/brush.gp5 rename to test-data/visual-tests/effects-and-annotations/brush.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/brush.png b/test-data/visual-tests/effects-and-annotations/brush.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/brush.png rename to test-data/visual-tests/effects-and-annotations/brush.png diff --git a/test-data/visual-tests/features/effects-and-annotations/chords.gp5 b/test-data/visual-tests/effects-and-annotations/chords.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/chords.gp5 rename to test-data/visual-tests/effects-and-annotations/chords.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/chords.png b/test-data/visual-tests/effects-and-annotations/chords.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/chords.png rename to test-data/visual-tests/effects-and-annotations/chords.png diff --git a/test-data/visual-tests/features/effects-and-annotations/dynamics.gp5 b/test-data/visual-tests/effects-and-annotations/dynamics.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/dynamics.gp5 rename to test-data/visual-tests/effects-and-annotations/dynamics.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/dynamics.png b/test-data/visual-tests/effects-and-annotations/dynamics.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/dynamics.png rename to test-data/visual-tests/effects-and-annotations/dynamics.png diff --git a/test-data/visual-tests/features/effects-and-annotations/fade-in.gp5 b/test-data/visual-tests/effects-and-annotations/fade-in.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/fade-in.gp5 rename to test-data/visual-tests/effects-and-annotations/fade-in.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/fade-in.png b/test-data/visual-tests/effects-and-annotations/fade-in.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/fade-in.png rename to test-data/visual-tests/effects-and-annotations/fade-in.png diff --git a/test-data/visual-tests/features/effects-and-annotations/fingering.gpx b/test-data/visual-tests/effects-and-annotations/fingering.gpx similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/fingering.gpx rename to test-data/visual-tests/effects-and-annotations/fingering.gpx diff --git a/test-data/visual-tests/features/effects-and-annotations/fingering.png b/test-data/visual-tests/effects-and-annotations/fingering.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/fingering.png rename to test-data/visual-tests/effects-and-annotations/fingering.png diff --git a/test-data/visual-tests/features/effects-and-annotations/let-ring.gp5 b/test-data/visual-tests/effects-and-annotations/let-ring.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/let-ring.gp5 rename to test-data/visual-tests/effects-and-annotations/let-ring.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/let-ring.png b/test-data/visual-tests/effects-and-annotations/let-ring.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/let-ring.png rename to test-data/visual-tests/effects-and-annotations/let-ring.png diff --git a/test-data/visual-tests/features/effects-and-annotations/markers.gp5 b/test-data/visual-tests/effects-and-annotations/markers.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/markers.gp5 rename to test-data/visual-tests/effects-and-annotations/markers.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/markers.png b/test-data/visual-tests/effects-and-annotations/markers.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/markers.png rename to test-data/visual-tests/effects-and-annotations/markers.png diff --git a/test-data/visual-tests/features/effects-and-annotations/palm-mute.gp5 b/test-data/visual-tests/effects-and-annotations/palm-mute.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/palm-mute.gp5 rename to test-data/visual-tests/effects-and-annotations/palm-mute.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/palm-mute.png b/test-data/visual-tests/effects-and-annotations/palm-mute.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/palm-mute.png rename to test-data/visual-tests/effects-and-annotations/palm-mute.png diff --git a/test-data/visual-tests/features/effects-and-annotations/pick-stroke.gp5 b/test-data/visual-tests/effects-and-annotations/pick-stroke.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/pick-stroke.gp5 rename to test-data/visual-tests/effects-and-annotations/pick-stroke.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/pick-stroke.png b/test-data/visual-tests/effects-and-annotations/pick-stroke.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/pick-stroke.png rename to test-data/visual-tests/effects-and-annotations/pick-stroke.png diff --git a/test-data/visual-tests/features/effects-and-annotations/rhythm-with-beams.png b/test-data/visual-tests/effects-and-annotations/rhythm-with-beams.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/rhythm-with-beams.png rename to test-data/visual-tests/effects-and-annotations/rhythm-with-beams.png diff --git a/test-data/visual-tests/features/effects-and-annotations/rhythm.png b/test-data/visual-tests/effects-and-annotations/rhythm.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/rhythm.png rename to test-data/visual-tests/effects-and-annotations/rhythm.png diff --git a/test-data/visual-tests/features/effects-and-annotations/slides.gp5 b/test-data/visual-tests/effects-and-annotations/slides.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/slides.gp5 rename to test-data/visual-tests/effects-and-annotations/slides.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/slides.png b/test-data/visual-tests/effects-and-annotations/slides.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/slides.png rename to test-data/visual-tests/effects-and-annotations/slides.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tap.gp5 b/test-data/visual-tests/effects-and-annotations/tap.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tap.gp5 rename to test-data/visual-tests/effects-and-annotations/tap.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/tap.png b/test-data/visual-tests/effects-and-annotations/tap.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tap.png rename to test-data/visual-tests/effects-and-annotations/tap.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tempo.gp5 b/test-data/visual-tests/effects-and-annotations/tempo.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tempo.gp5 rename to test-data/visual-tests/effects-and-annotations/tempo.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/tempo.png b/test-data/visual-tests/effects-and-annotations/tempo.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tempo.png rename to test-data/visual-tests/effects-and-annotations/tempo.png diff --git a/test-data/visual-tests/features/effects-and-annotations/text.gp5 b/test-data/visual-tests/effects-and-annotations/text.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/text.gp5 rename to test-data/visual-tests/effects-and-annotations/text.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/text.png b/test-data/visual-tests/effects-and-annotations/text.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/text.png rename to test-data/visual-tests/effects-and-annotations/text.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tremolo-bar.gp b/test-data/visual-tests/effects-and-annotations/tremolo-bar.gp similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tremolo-bar.gp rename to test-data/visual-tests/effects-and-annotations/tremolo-bar.gp diff --git a/test-data/visual-tests/features/effects-and-annotations/tremolo-bar.png b/test-data/visual-tests/effects-and-annotations/tremolo-bar.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tremolo-bar.png rename to test-data/visual-tests/effects-and-annotations/tremolo-bar.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tremolo-picking.gp5 b/test-data/visual-tests/effects-and-annotations/tremolo-picking.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tremolo-picking.gp5 rename to test-data/visual-tests/effects-and-annotations/tremolo-picking.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/tremolo-picking.png b/test-data/visual-tests/effects-and-annotations/tremolo-picking.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tremolo-picking.png rename to test-data/visual-tests/effects-and-annotations/tremolo-picking.png diff --git a/test-data/visual-tests/features/effects-and-annotations/trill.gp5 b/test-data/visual-tests/effects-and-annotations/trill.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/trill.gp5 rename to test-data/visual-tests/effects-and-annotations/trill.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/trill.png b/test-data/visual-tests/effects-and-annotations/trill.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/trill.png rename to test-data/visual-tests/effects-and-annotations/trill.png diff --git a/test-data/visual-tests/features/effects-and-annotations/triplet-feel.gpx b/test-data/visual-tests/effects-and-annotations/triplet-feel.gpx similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/triplet-feel.gpx rename to test-data/visual-tests/effects-and-annotations/triplet-feel.gpx diff --git a/test-data/visual-tests/features/effects-and-annotations/triplet-feel.png b/test-data/visual-tests/effects-and-annotations/triplet-feel.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/triplet-feel.png rename to test-data/visual-tests/effects-and-annotations/triplet-feel.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tuning.png b/test-data/visual-tests/effects-and-annotations/tuning.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tuning.png rename to test-data/visual-tests/effects-and-annotations/tuning.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tuplets-advanced.gp b/test-data/visual-tests/effects-and-annotations/tuplets-advanced.gp similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tuplets-advanced.gp rename to test-data/visual-tests/effects-and-annotations/tuplets-advanced.gp diff --git a/test-data/visual-tests/features/effects-and-annotations/tuplets-advanced.png b/test-data/visual-tests/effects-and-annotations/tuplets-advanced.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tuplets-advanced.png rename to test-data/visual-tests/effects-and-annotations/tuplets-advanced.png diff --git a/test-data/visual-tests/features/effects-and-annotations/tuplets.gp5 b/test-data/visual-tests/effects-and-annotations/tuplets.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tuplets.gp5 rename to test-data/visual-tests/effects-and-annotations/tuplets.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/tuplets.png b/test-data/visual-tests/effects-and-annotations/tuplets.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/tuplets.png rename to test-data/visual-tests/effects-and-annotations/tuplets.png diff --git a/test-data/visual-tests/features/effects-and-annotations/vibrato.gp5 b/test-data/visual-tests/effects-and-annotations/vibrato.gp5 similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/vibrato.gp5 rename to test-data/visual-tests/effects-and-annotations/vibrato.gp5 diff --git a/test-data/visual-tests/features/effects-and-annotations/vibrato.png b/test-data/visual-tests/effects-and-annotations/vibrato.png similarity index 100% rename from test-data/visual-tests/features/effects-and-annotations/vibrato.png rename to test-data/visual-tests/effects-and-annotations/vibrato.png diff --git a/test-data/visual-tests/features/general/alternate-endings.gp5 b/test-data/visual-tests/general/alternate-endings.gp5 similarity index 100% rename from test-data/visual-tests/features/general/alternate-endings.gp5 rename to test-data/visual-tests/general/alternate-endings.gp5 diff --git a/test-data/visual-tests/features/general/alternate-endings.png b/test-data/visual-tests/general/alternate-endings.png similarity index 100% rename from test-data/visual-tests/features/general/alternate-endings.png rename to test-data/visual-tests/general/alternate-endings.png diff --git a/test-data/visual-tests/features/general/repeats.gp5 b/test-data/visual-tests/general/repeats.gp5 similarity index 100% rename from test-data/visual-tests/features/general/repeats.gp5 rename to test-data/visual-tests/general/repeats.gp5 diff --git a/test-data/visual-tests/features/general/repeats.png b/test-data/visual-tests/general/repeats.png similarity index 100% rename from test-data/visual-tests/features/general/repeats.png rename to test-data/visual-tests/general/repeats.png diff --git a/test-data/visual-tests/features/general/song-details.gp5 b/test-data/visual-tests/general/song-details.gp5 similarity index 100% rename from test-data/visual-tests/features/general/song-details.gp5 rename to test-data/visual-tests/general/song-details.gp5 diff --git a/test-data/visual-tests/features/general/song-details.png b/test-data/visual-tests/general/song-details.png similarity index 100% rename from test-data/visual-tests/features/general/song-details.png rename to test-data/visual-tests/general/song-details.png diff --git a/test-data/visual-tests/features/general/tuning.gp5 b/test-data/visual-tests/general/tuning.gp5 similarity index 100% rename from test-data/visual-tests/features/general/tuning.gp5 rename to test-data/visual-tests/general/tuning.gp5 diff --git a/test-data/visual-tests/features/general/tuning.png b/test-data/visual-tests/general/tuning.png similarity index 100% rename from test-data/visual-tests/features/general/tuning.png rename to test-data/visual-tests/general/tuning.png diff --git a/test-data/visual-tests/features/guitar-tabs/rhythm-with-beams.gp5 b/test-data/visual-tests/guitar-tabs/rhythm-with-beams.gp5 similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/rhythm-with-beams.gp5 rename to test-data/visual-tests/guitar-tabs/rhythm-with-beams.gp5 diff --git a/test-data/visual-tests/features/guitar-tabs/rhythm-with-beams.png b/test-data/visual-tests/guitar-tabs/rhythm-with-beams.png similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/rhythm-with-beams.png rename to test-data/visual-tests/guitar-tabs/rhythm-with-beams.png diff --git a/test-data/visual-tests/features/guitar-tabs/rhythm.gp5 b/test-data/visual-tests/guitar-tabs/rhythm.gp5 similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/rhythm.gp5 rename to test-data/visual-tests/guitar-tabs/rhythm.gp5 diff --git a/test-data/visual-tests/features/guitar-tabs/rhythm.png b/test-data/visual-tests/guitar-tabs/rhythm.png similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/rhythm.png rename to test-data/visual-tests/guitar-tabs/rhythm.png diff --git a/test-data/visual-tests/features/guitar-tabs/string-variations.gp5 b/test-data/visual-tests/guitar-tabs/string-variations.gp5 similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/string-variations.gp5 rename to test-data/visual-tests/guitar-tabs/string-variations.gp5 diff --git a/test-data/visual-tests/features/guitar-tabs/string-variations.png b/test-data/visual-tests/guitar-tabs/string-variations.png similarity index 100% rename from test-data/visual-tests/features/guitar-tabs/string-variations.png rename to test-data/visual-tests/guitar-tabs/string-variations.png diff --git a/test-data/visual-tests/features/layout/grace-notes-advanced.png b/test-data/visual-tests/layout/grace-notes-advanced.png similarity index 100% rename from test-data/visual-tests/features/layout/grace-notes-advanced.png rename to test-data/visual-tests/layout/grace-notes-advanced.png diff --git a/test-data/visual-tests/features/layout/horizontal-layout-5to8.gp5 b/test-data/visual-tests/layout/horizontal-layout-5to8.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/horizontal-layout-5to8.gp5 rename to test-data/visual-tests/layout/horizontal-layout-5to8.gp5 diff --git a/test-data/visual-tests/features/layout/horizontal-layout-5to8.png b/test-data/visual-tests/layout/horizontal-layout-5to8.png similarity index 100% rename from test-data/visual-tests/features/layout/horizontal-layout-5to8.png rename to test-data/visual-tests/layout/horizontal-layout-5to8.png diff --git a/test-data/visual-tests/features/layout/horizontal-layout.gp5 b/test-data/visual-tests/layout/horizontal-layout.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/horizontal-layout.gp5 rename to test-data/visual-tests/layout/horizontal-layout.gp5 diff --git a/test-data/visual-tests/features/layout/horizontal-layout.png b/test-data/visual-tests/layout/horizontal-layout.png similarity index 100% rename from test-data/visual-tests/features/layout/horizontal-layout.png rename to test-data/visual-tests/layout/horizontal-layout.png diff --git a/test-data/visual-tests/features/layout/multi-track.gp5 b/test-data/visual-tests/layout/multi-track.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/multi-track.gp5 rename to test-data/visual-tests/layout/multi-track.gp5 diff --git a/test-data/visual-tests/features/layout/multi-track.png b/test-data/visual-tests/layout/multi-track.png similarity index 100% rename from test-data/visual-tests/features/layout/multi-track.png rename to test-data/visual-tests/layout/multi-track.png diff --git a/test-data/visual-tests/features/layout/multi-voice.gp5 b/test-data/visual-tests/layout/multi-voice.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/multi-voice.gp5 rename to test-data/visual-tests/layout/multi-voice.gp5 diff --git a/test-data/visual-tests/features/layout/multi-voice.png b/test-data/visual-tests/layout/multi-voice.png similarity index 100% rename from test-data/visual-tests/features/layout/multi-voice.png rename to test-data/visual-tests/layout/multi-voice.png diff --git a/test-data/visual-tests/features/layout/page-layout-5barsperrow.gp5 b/test-data/visual-tests/layout/page-layout-5barsperrow.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/page-layout-5barsperrow.gp5 rename to test-data/visual-tests/layout/page-layout-5barsperrow.gp5 diff --git a/test-data/visual-tests/features/layout/page-layout-5barsperrow.png b/test-data/visual-tests/layout/page-layout-5barsperrow.png similarity index 100% rename from test-data/visual-tests/features/layout/page-layout-5barsperrow.png rename to test-data/visual-tests/layout/page-layout-5barsperrow.png diff --git a/test-data/visual-tests/features/layout/page-layout-5to8.gp5 b/test-data/visual-tests/layout/page-layout-5to8.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/page-layout-5to8.gp5 rename to test-data/visual-tests/layout/page-layout-5to8.gp5 diff --git a/test-data/visual-tests/features/layout/page-layout-5to8.png b/test-data/visual-tests/layout/page-layout-5to8.png similarity index 100% rename from test-data/visual-tests/features/layout/page-layout-5to8.png rename to test-data/visual-tests/layout/page-layout-5to8.png diff --git a/test-data/visual-tests/features/layout/page-layout.gp5 b/test-data/visual-tests/layout/page-layout.gp5 similarity index 100% rename from test-data/visual-tests/features/layout/page-layout.gp5 rename to test-data/visual-tests/layout/page-layout.gp5 diff --git a/test-data/visual-tests/features/layout/page-layout.png b/test-data/visual-tests/layout/page-layout.png similarity index 100% rename from test-data/visual-tests/features/layout/page-layout.png rename to test-data/visual-tests/layout/page-layout.png diff --git a/test-data/visual-tests/features/layout/tied-notes.png b/test-data/visual-tests/layout/tied-notes.png similarity index 100% rename from test-data/visual-tests/features/layout/tied-notes.png rename to test-data/visual-tests/layout/tied-notes.png diff --git a/test-data/visual-tests/features/music-notation/accidentals.gp5 b/test-data/visual-tests/music-notation/accidentals.gp5 similarity index 100% rename from test-data/visual-tests/features/music-notation/accidentals.gp5 rename to test-data/visual-tests/music-notation/accidentals.gp5 diff --git a/test-data/visual-tests/features/music-notation/accidentals.png b/test-data/visual-tests/music-notation/accidentals.png similarity index 100% rename from test-data/visual-tests/features/music-notation/accidentals.png rename to test-data/visual-tests/music-notation/accidentals.png diff --git a/test-data/visual-tests/features/music-notation/clefs.gpx b/test-data/visual-tests/music-notation/clefs.gpx similarity index 100% rename from test-data/visual-tests/features/music-notation/clefs.gpx rename to test-data/visual-tests/music-notation/clefs.gpx diff --git a/test-data/visual-tests/features/music-notation/clefs.png b/test-data/visual-tests/music-notation/clefs.png similarity index 100% rename from test-data/visual-tests/features/music-notation/clefs.png rename to test-data/visual-tests/music-notation/clefs.png diff --git a/test-data/visual-tests/features/music-notation/forced-accidentals.gp b/test-data/visual-tests/music-notation/forced-accidentals.gp similarity index 100% rename from test-data/visual-tests/features/music-notation/forced-accidentals.gp rename to test-data/visual-tests/music-notation/forced-accidentals.gp diff --git a/test-data/visual-tests/features/music-notation/forced-accidentals.png b/test-data/visual-tests/music-notation/forced-accidentals.png similarity index 100% rename from test-data/visual-tests/features/music-notation/forced-accidentals.png rename to test-data/visual-tests/music-notation/forced-accidentals.png diff --git a/test-data/visual-tests/features/music-notation/key-signatures.gp b/test-data/visual-tests/music-notation/key-signatures.gp similarity index 100% rename from test-data/visual-tests/features/music-notation/key-signatures.gp rename to test-data/visual-tests/music-notation/key-signatures.gp diff --git a/test-data/visual-tests/features/music-notation/key-signatures.png b/test-data/visual-tests/music-notation/key-signatures.png similarity index 100% rename from test-data/visual-tests/features/music-notation/key-signatures.png rename to test-data/visual-tests/music-notation/key-signatures.png diff --git a/test-data/visual-tests/features/music-notation/notes-rests-beams.gp5 b/test-data/visual-tests/music-notation/notes-rests-beams.gp5 similarity index 100% rename from test-data/visual-tests/features/music-notation/notes-rests-beams.gp5 rename to test-data/visual-tests/music-notation/notes-rests-beams.gp5 diff --git a/test-data/visual-tests/features/music-notation/notes-rests-beams.png b/test-data/visual-tests/music-notation/notes-rests-beams.png similarity index 100% rename from test-data/visual-tests/features/music-notation/notes-rests-beams.png rename to test-data/visual-tests/music-notation/notes-rests-beams.png diff --git a/test-data/visual-tests/features/music-notation/time-signatures.gp5 b/test-data/visual-tests/music-notation/time-signatures.gp5 similarity index 100% rename from test-data/visual-tests/features/music-notation/time-signatures.gp5 rename to test-data/visual-tests/music-notation/time-signatures.gp5 diff --git a/test-data/visual-tests/features/music-notation/time-signatures.png b/test-data/visual-tests/music-notation/time-signatures.png similarity index 100% rename from test-data/visual-tests/features/music-notation/time-signatures.png rename to test-data/visual-tests/music-notation/time-signatures.png diff --git a/test-data/visual-tests/features/notation-elements/chord-diagrams-off.png b/test-data/visual-tests/notation-elements/chord-diagrams-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/chord-diagrams-off.png rename to test-data/visual-tests/notation-elements/chord-diagrams-off.png diff --git a/test-data/visual-tests/features/notation-elements/chord-diagrams-on.png b/test-data/visual-tests/notation-elements/chord-diagrams-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/chord-diagrams-on.png rename to test-data/visual-tests/notation-elements/chord-diagrams-on.png diff --git a/test-data/visual-tests/features/notation-elements/effects-off.png b/test-data/visual-tests/notation-elements/effects-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/effects-off.png rename to test-data/visual-tests/notation-elements/effects-off.png diff --git a/test-data/visual-tests/features/notation-elements/effects-on.png b/test-data/visual-tests/notation-elements/effects-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/effects-on.png rename to test-data/visual-tests/notation-elements/effects-on.png diff --git a/test-data/visual-tests/features/notation-elements/guitar-tuning-off.png b/test-data/visual-tests/notation-elements/guitar-tuning-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/guitar-tuning-off.png rename to test-data/visual-tests/notation-elements/guitar-tuning-off.png diff --git a/test-data/visual-tests/features/notation-elements/guitar-tuning-on.png b/test-data/visual-tests/notation-elements/guitar-tuning-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/guitar-tuning-on.png rename to test-data/visual-tests/notation-elements/guitar-tuning-on.png diff --git a/test-data/visual-tests/features/notation-elements/parenthesis-on-tied-bends-off.png b/test-data/visual-tests/notation-elements/parenthesis-on-tied-bends-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/parenthesis-on-tied-bends-off.png rename to test-data/visual-tests/notation-elements/parenthesis-on-tied-bends-off.png diff --git a/test-data/visual-tests/features/notation-elements/parenthesis-on-tied-bends-on.png b/test-data/visual-tests/notation-elements/parenthesis-on-tied-bends-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/parenthesis-on-tied-bends-on.png rename to test-data/visual-tests/notation-elements/parenthesis-on-tied-bends-on.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-album.png b/test-data/visual-tests/notation-elements/score-info-album.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-album.png rename to test-data/visual-tests/notation-elements/score-info-album.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-all.png b/test-data/visual-tests/notation-elements/score-info-all.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-all.png rename to test-data/visual-tests/notation-elements/score-info-all.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-artist.png b/test-data/visual-tests/notation-elements/score-info-artist.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-artist.png rename to test-data/visual-tests/notation-elements/score-info-artist.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-copyright.png b/test-data/visual-tests/notation-elements/score-info-copyright.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-copyright.png rename to test-data/visual-tests/notation-elements/score-info-copyright.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-music.png b/test-data/visual-tests/notation-elements/score-info-music.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-music.png rename to test-data/visual-tests/notation-elements/score-info-music.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-subtitle.png b/test-data/visual-tests/notation-elements/score-info-subtitle.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-subtitle.png rename to test-data/visual-tests/notation-elements/score-info-subtitle.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-title.png b/test-data/visual-tests/notation-elements/score-info-title.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-title.png rename to test-data/visual-tests/notation-elements/score-info-title.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-words-and-music.png b/test-data/visual-tests/notation-elements/score-info-words-and-music.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-words-and-music.png rename to test-data/visual-tests/notation-elements/score-info-words-and-music.png diff --git a/test-data/visual-tests/features/notation-elements/score-info-words.png b/test-data/visual-tests/notation-elements/score-info-words.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/score-info-words.png rename to test-data/visual-tests/notation-elements/score-info-words.png diff --git a/test-data/visual-tests/features/notation-elements/tab-notes-on-tied-bends-off.png b/test-data/visual-tests/notation-elements/tab-notes-on-tied-bends-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/tab-notes-on-tied-bends-off.png rename to test-data/visual-tests/notation-elements/tab-notes-on-tied-bends-off.png diff --git a/test-data/visual-tests/features/notation-elements/tab-notes-on-tied-bends-on.png b/test-data/visual-tests/notation-elements/tab-notes-on-tied-bends-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/tab-notes-on-tied-bends-on.png rename to test-data/visual-tests/notation-elements/tab-notes-on-tied-bends-on.png diff --git a/test-data/visual-tests/features/notation-elements/track-names-off.png b/test-data/visual-tests/notation-elements/track-names-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/track-names-off.png rename to test-data/visual-tests/notation-elements/track-names-off.png diff --git a/test-data/visual-tests/features/notation-elements/track-names-on.png b/test-data/visual-tests/notation-elements/track-names-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/track-names-on.png rename to test-data/visual-tests/notation-elements/track-names-on.png diff --git a/test-data/visual-tests/features/notation-elements/zeros-on-dive-whammys-off.png b/test-data/visual-tests/notation-elements/zeros-on-dive-whammys-off.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/zeros-on-dive-whammys-off.png rename to test-data/visual-tests/notation-elements/zeros-on-dive-whammys-off.png diff --git a/test-data/visual-tests/features/notation-elements/zeros-on-dive-whammys-on.png b/test-data/visual-tests/notation-elements/zeros-on-dive-whammys-on.png similarity index 100% rename from test-data/visual-tests/features/notation-elements/zeros-on-dive-whammys-on.png rename to test-data/visual-tests/notation-elements/zeros-on-dive-whammys-on.png diff --git a/test-data/visual-tests/notation-legend/accentuations-default.png b/test-data/visual-tests/notation-legend/accentuations-default.png new file mode 100644 index 000000000..9a05b1765 Binary files /dev/null and b/test-data/visual-tests/notation-legend/accentuations-default.png differ diff --git a/test-data/visual-tests/notation-legend/accentuations-songbook.png b/test-data/visual-tests/notation-legend/accentuations-songbook.png new file mode 100644 index 000000000..0e2d10ec7 Binary files /dev/null and b/test-data/visual-tests/notation-legend/accentuations-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/arpeggio-default.png b/test-data/visual-tests/notation-legend/arpeggio-default.png new file mode 100644 index 000000000..8f7a95de5 Binary files /dev/null and b/test-data/visual-tests/notation-legend/arpeggio-default.png differ diff --git a/test-data/visual-tests/notation-legend/arpeggio-songbook.png b/test-data/visual-tests/notation-legend/arpeggio-songbook.png new file mode 100644 index 000000000..8f7a95de5 Binary files /dev/null and b/test-data/visual-tests/notation-legend/arpeggio-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/bends-default.png b/test-data/visual-tests/notation-legend/bends-default.png new file mode 100644 index 000000000..200162c9f Binary files /dev/null and b/test-data/visual-tests/notation-legend/bends-default.png differ diff --git a/test-data/visual-tests/notation-legend/bends-songbook.png b/test-data/visual-tests/notation-legend/bends-songbook.png new file mode 100644 index 000000000..ca187f54d Binary files /dev/null and b/test-data/visual-tests/notation-legend/bends-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/chords-default.png b/test-data/visual-tests/notation-legend/chords-default.png new file mode 100644 index 000000000..c89633196 Binary files /dev/null and b/test-data/visual-tests/notation-legend/chords-default.png differ diff --git a/test-data/visual-tests/notation-legend/chords-songbook.png b/test-data/visual-tests/notation-legend/chords-songbook.png new file mode 100644 index 000000000..c89633196 Binary files /dev/null and b/test-data/visual-tests/notation-legend/chords-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/crescendo-default.png b/test-data/visual-tests/notation-legend/crescendo-default.png new file mode 100644 index 000000000..0a0cde59e Binary files /dev/null and b/test-data/visual-tests/notation-legend/crescendo-default.png differ diff --git a/test-data/visual-tests/notation-legend/crescendo-songbook.png b/test-data/visual-tests/notation-legend/crescendo-songbook.png new file mode 100644 index 000000000..0a0cde59e Binary files /dev/null and b/test-data/visual-tests/notation-legend/crescendo-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/dead-default.png b/test-data/visual-tests/notation-legend/dead-default.png new file mode 100644 index 000000000..c10da03a0 Binary files /dev/null and b/test-data/visual-tests/notation-legend/dead-default.png differ diff --git a/test-data/visual-tests/notation-legend/dead-songbook.png b/test-data/visual-tests/notation-legend/dead-songbook.png new file mode 100644 index 000000000..c10da03a0 Binary files /dev/null and b/test-data/visual-tests/notation-legend/dead-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/dynamics-default.png b/test-data/visual-tests/notation-legend/dynamics-default.png new file mode 100644 index 000000000..e6dcdc65f Binary files /dev/null and b/test-data/visual-tests/notation-legend/dynamics-default.png differ diff --git a/test-data/visual-tests/notation-legend/dynamics-songbook.png b/test-data/visual-tests/notation-legend/dynamics-songbook.png new file mode 100644 index 000000000..e6dcdc65f Binary files /dev/null and b/test-data/visual-tests/notation-legend/dynamics-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/fingering-default.png b/test-data/visual-tests/notation-legend/fingering-default.png new file mode 100644 index 000000000..789748a09 Binary files /dev/null and b/test-data/visual-tests/notation-legend/fingering-default.png differ diff --git a/test-data/visual-tests/notation-legend/fingering-songbook.png b/test-data/visual-tests/notation-legend/fingering-songbook.png new file mode 100644 index 000000000..edea9785b Binary files /dev/null and b/test-data/visual-tests/notation-legend/fingering-songbook.png differ diff --git a/test-data/visual-tests/features/general/notation-legend-default.png b/test-data/visual-tests/notation-legend/full-default.png similarity index 100% rename from test-data/visual-tests/features/general/notation-legend-default.png rename to test-data/visual-tests/notation-legend/full-default.png diff --git a/test-data/visual-tests/features/general/notation-legend-songbook.png b/test-data/visual-tests/notation-legend/full-songbook.png similarity index 100% rename from test-data/visual-tests/features/general/notation-legend-songbook.png rename to test-data/visual-tests/notation-legend/full-songbook.png diff --git a/test-data/visual-tests/notation-legend/grace-default.png b/test-data/visual-tests/notation-legend/grace-default.png new file mode 100644 index 000000000..c233ec4e5 Binary files /dev/null and b/test-data/visual-tests/notation-legend/grace-default.png differ diff --git a/test-data/visual-tests/notation-legend/grace-songbook.png b/test-data/visual-tests/notation-legend/grace-songbook.png new file mode 100644 index 000000000..36393c4f4 Binary files /dev/null and b/test-data/visual-tests/notation-legend/grace-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/hammer-default.png b/test-data/visual-tests/notation-legend/hammer-default.png new file mode 100644 index 000000000..583e1ebfb Binary files /dev/null and b/test-data/visual-tests/notation-legend/hammer-default.png differ diff --git a/test-data/visual-tests/notation-legend/hammer-songbook.png b/test-data/visual-tests/notation-legend/hammer-songbook.png new file mode 100644 index 000000000..583e1ebfb Binary files /dev/null and b/test-data/visual-tests/notation-legend/hammer-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/harmonics-default.png b/test-data/visual-tests/notation-legend/harmonics-default.png new file mode 100644 index 000000000..533ba57b5 Binary files /dev/null and b/test-data/visual-tests/notation-legend/harmonics-default.png differ diff --git a/test-data/visual-tests/notation-legend/harmonics-songbook.png b/test-data/visual-tests/notation-legend/harmonics-songbook.png new file mode 100644 index 000000000..533ba57b5 Binary files /dev/null and b/test-data/visual-tests/notation-legend/harmonics-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/let-ring-default.png b/test-data/visual-tests/notation-legend/let-ring-default.png new file mode 100644 index 000000000..b63604a61 Binary files /dev/null and b/test-data/visual-tests/notation-legend/let-ring-default.png differ diff --git a/test-data/visual-tests/notation-legend/let-ring-songbook.png b/test-data/visual-tests/notation-legend/let-ring-songbook.png new file mode 100644 index 000000000..e3088522f Binary files /dev/null and b/test-data/visual-tests/notation-legend/let-ring-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/mixed-default.png b/test-data/visual-tests/notation-legend/mixed-default.png new file mode 100644 index 000000000..f46c9fee8 Binary files /dev/null and b/test-data/visual-tests/notation-legend/mixed-default.png differ diff --git a/test-data/visual-tests/notation-legend/mixed-songbook.png b/test-data/visual-tests/notation-legend/mixed-songbook.png new file mode 100644 index 000000000..99eeac65a Binary files /dev/null and b/test-data/visual-tests/notation-legend/mixed-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/multi-grace-default.png b/test-data/visual-tests/notation-legend/multi-grace-default.png new file mode 100644 index 000000000..b9f4813de Binary files /dev/null and b/test-data/visual-tests/notation-legend/multi-grace-default.png differ diff --git a/test-data/visual-tests/notation-legend/multi-grace-songbook.png b/test-data/visual-tests/notation-legend/multi-grace-songbook.png new file mode 100644 index 000000000..57954e928 Binary files /dev/null and b/test-data/visual-tests/notation-legend/multi-grace-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/multi-voice-default.png b/test-data/visual-tests/notation-legend/multi-voice-default.png new file mode 100644 index 000000000..8e9c05549 Binary files /dev/null and b/test-data/visual-tests/notation-legend/multi-voice-default.png differ diff --git a/test-data/visual-tests/notation-legend/multi-voice-songbook.png b/test-data/visual-tests/notation-legend/multi-voice-songbook.png new file mode 100644 index 000000000..8e9c05549 Binary files /dev/null and b/test-data/visual-tests/notation-legend/multi-voice-songbook.png differ diff --git a/test-data/visual-tests/features/general/notation-legend.gp b/test-data/visual-tests/notation-legend/notation-legend.gp similarity index 100% rename from test-data/visual-tests/features/general/notation-legend.gp rename to test-data/visual-tests/notation-legend/notation-legend.gp diff --git a/test-data/visual-tests/notation-legend/ottavia-default.png b/test-data/visual-tests/notation-legend/ottavia-default.png new file mode 100644 index 000000000..93509f95a Binary files /dev/null and b/test-data/visual-tests/notation-legend/ottavia-default.png differ diff --git a/test-data/visual-tests/notation-legend/ottavia-songbook.png b/test-data/visual-tests/notation-legend/ottavia-songbook.png new file mode 100644 index 000000000..93509f95a Binary files /dev/null and b/test-data/visual-tests/notation-legend/ottavia-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/pick-stroke-default.png b/test-data/visual-tests/notation-legend/pick-stroke-default.png new file mode 100644 index 000000000..8784d0040 Binary files /dev/null and b/test-data/visual-tests/notation-legend/pick-stroke-default.png differ diff --git a/test-data/visual-tests/notation-legend/pick-stroke-songbook.png b/test-data/visual-tests/notation-legend/pick-stroke-songbook.png new file mode 100644 index 000000000..8784d0040 Binary files /dev/null and b/test-data/visual-tests/notation-legend/pick-stroke-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/slash-default.png b/test-data/visual-tests/notation-legend/slash-default.png new file mode 100644 index 000000000..d4ab5585d Binary files /dev/null and b/test-data/visual-tests/notation-legend/slash-default.png differ diff --git a/test-data/visual-tests/notation-legend/slash-songbook.png b/test-data/visual-tests/notation-legend/slash-songbook.png new file mode 100644 index 000000000..d4ab5585d Binary files /dev/null and b/test-data/visual-tests/notation-legend/slash-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/slides-default.png b/test-data/visual-tests/notation-legend/slides-default.png new file mode 100644 index 000000000..b384d3b70 Binary files /dev/null and b/test-data/visual-tests/notation-legend/slides-default.png differ diff --git a/test-data/visual-tests/notation-legend/slides-songbook.png b/test-data/visual-tests/notation-legend/slides-songbook.png new file mode 100644 index 000000000..b384d3b70 Binary files /dev/null and b/test-data/visual-tests/notation-legend/slides-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/staccatissimo-default.png b/test-data/visual-tests/notation-legend/staccatissimo-default.png new file mode 100644 index 000000000..7684151e2 Binary files /dev/null and b/test-data/visual-tests/notation-legend/staccatissimo-default.png differ diff --git a/test-data/visual-tests/notation-legend/staccatissimo-songbook.png b/test-data/visual-tests/notation-legend/staccatissimo-songbook.png new file mode 100644 index 000000000..7684151e2 Binary files /dev/null and b/test-data/visual-tests/notation-legend/staccatissimo-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/sweep-default.png b/test-data/visual-tests/notation-legend/sweep-default.png new file mode 100644 index 000000000..fbfc43065 Binary files /dev/null and b/test-data/visual-tests/notation-legend/sweep-default.png differ diff --git a/test-data/visual-tests/notation-legend/sweep-songbook.png b/test-data/visual-tests/notation-legend/sweep-songbook.png new file mode 100644 index 000000000..e6dcdc65f Binary files /dev/null and b/test-data/visual-tests/notation-legend/sweep-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/tap-riff-default.png b/test-data/visual-tests/notation-legend/tap-riff-default.png new file mode 100644 index 000000000..30a9c3c1c Binary files /dev/null and b/test-data/visual-tests/notation-legend/tap-riff-default.png differ diff --git a/test-data/visual-tests/notation-legend/tap-riff-songbook.png b/test-data/visual-tests/notation-legend/tap-riff-songbook.png new file mode 100644 index 000000000..30a9c3c1c Binary files /dev/null and b/test-data/visual-tests/notation-legend/tap-riff-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/tempo-change-default.png b/test-data/visual-tests/notation-legend/tempo-change-default.png new file mode 100644 index 000000000..5a66a0f5a Binary files /dev/null and b/test-data/visual-tests/notation-legend/tempo-change-default.png differ diff --git a/test-data/visual-tests/notation-legend/tempo-change-songbook.png b/test-data/visual-tests/notation-legend/tempo-change-songbook.png new file mode 100644 index 000000000..24f3c12ca Binary files /dev/null and b/test-data/visual-tests/notation-legend/tempo-change-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/text-default.png b/test-data/visual-tests/notation-legend/text-default.png new file mode 100644 index 000000000..2d897bb3f Binary files /dev/null and b/test-data/visual-tests/notation-legend/text-default.png differ diff --git a/test-data/visual-tests/notation-legend/text-songbook.png b/test-data/visual-tests/notation-legend/text-songbook.png new file mode 100644 index 000000000..2d897bb3f Binary files /dev/null and b/test-data/visual-tests/notation-legend/text-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/trill-default.png b/test-data/visual-tests/notation-legend/trill-default.png new file mode 100644 index 000000000..bb97da02d Binary files /dev/null and b/test-data/visual-tests/notation-legend/trill-default.png differ diff --git a/test-data/visual-tests/notation-legend/trill-songbook.png b/test-data/visual-tests/notation-legend/trill-songbook.png new file mode 100644 index 000000000..bb97da02d Binary files /dev/null and b/test-data/visual-tests/notation-legend/trill-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/triplet-feel-default.png b/test-data/visual-tests/notation-legend/triplet-feel-default.png new file mode 100644 index 000000000..8d498871e Binary files /dev/null and b/test-data/visual-tests/notation-legend/triplet-feel-default.png differ diff --git a/test-data/visual-tests/notation-legend/triplet-feel-songbook.png b/test-data/visual-tests/notation-legend/triplet-feel-songbook.png new file mode 100644 index 000000000..8d498871e Binary files /dev/null and b/test-data/visual-tests/notation-legend/triplet-feel-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/vibrato-default.png b/test-data/visual-tests/notation-legend/vibrato-default.png new file mode 100644 index 000000000..bdca1a7fc Binary files /dev/null and b/test-data/visual-tests/notation-legend/vibrato-default.png differ diff --git a/test-data/visual-tests/notation-legend/vibrato-songbook.png b/test-data/visual-tests/notation-legend/vibrato-songbook.png new file mode 100644 index 000000000..bdca1a7fc Binary files /dev/null and b/test-data/visual-tests/notation-legend/vibrato-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/wah-default.png b/test-data/visual-tests/notation-legend/wah-default.png new file mode 100644 index 000000000..6f2fb8236 Binary files /dev/null and b/test-data/visual-tests/notation-legend/wah-default.png differ diff --git a/test-data/visual-tests/notation-legend/wah-songbook.png b/test-data/visual-tests/notation-legend/wah-songbook.png new file mode 100644 index 000000000..6f2fb8236 Binary files /dev/null and b/test-data/visual-tests/notation-legend/wah-songbook.png differ diff --git a/test-data/visual-tests/notation-legend/whammy-default.png b/test-data/visual-tests/notation-legend/whammy-default.png new file mode 100644 index 000000000..c4a702952 Binary files /dev/null and b/test-data/visual-tests/notation-legend/whammy-default.png differ diff --git a/test-data/visual-tests/notation-legend/whammy-songbook.png b/test-data/visual-tests/notation-legend/whammy-songbook.png new file mode 100644 index 000000000..62a4d92a6 Binary files /dev/null and b/test-data/visual-tests/notation-legend/whammy-songbook.png differ diff --git a/test-data/visual-tests/features/special-notes/dead-notes.gp5 b/test-data/visual-tests/special-notes/dead-notes.gp5 similarity index 100% rename from test-data/visual-tests/features/special-notes/dead-notes.gp5 rename to test-data/visual-tests/special-notes/dead-notes.gp5 diff --git a/test-data/visual-tests/features/special-notes/dead-notes.png b/test-data/visual-tests/special-notes/dead-notes.png similarity index 100% rename from test-data/visual-tests/features/special-notes/dead-notes.png rename to test-data/visual-tests/special-notes/dead-notes.png diff --git a/test-data/visual-tests/features/special-notes/ghost-notes.gp5 b/test-data/visual-tests/special-notes/ghost-notes.gp5 similarity index 100% rename from test-data/visual-tests/features/special-notes/ghost-notes.gp5 rename to test-data/visual-tests/special-notes/ghost-notes.gp5 diff --git a/test-data/visual-tests/features/special-notes/ghost-notes.png b/test-data/visual-tests/special-notes/ghost-notes.png similarity index 100% rename from test-data/visual-tests/features/special-notes/ghost-notes.png rename to test-data/visual-tests/special-notes/ghost-notes.png diff --git a/test-data/visual-tests/features/special-notes/grace-notes-advanced.gp b/test-data/visual-tests/special-notes/grace-notes-advanced.gp similarity index 100% rename from test-data/visual-tests/features/special-notes/grace-notes-advanced.gp rename to test-data/visual-tests/special-notes/grace-notes-advanced.gp diff --git a/test-data/visual-tests/features/special-notes/grace-notes-advanced.png b/test-data/visual-tests/special-notes/grace-notes-advanced.png similarity index 100% rename from test-data/visual-tests/features/special-notes/grace-notes-advanced.png rename to test-data/visual-tests/special-notes/grace-notes-advanced.png diff --git a/test-data/visual-tests/features/special-notes/grace-notes.gp5 b/test-data/visual-tests/special-notes/grace-notes.gp5 similarity index 100% rename from test-data/visual-tests/features/special-notes/grace-notes.gp5 rename to test-data/visual-tests/special-notes/grace-notes.gp5 diff --git a/test-data/visual-tests/features/special-notes/grace-notes.png b/test-data/visual-tests/special-notes/grace-notes.png similarity index 100% rename from test-data/visual-tests/features/special-notes/grace-notes.png rename to test-data/visual-tests/special-notes/grace-notes.png diff --git a/test-data/visual-tests/features/special-notes/tied-notes.gp5 b/test-data/visual-tests/special-notes/tied-notes.gp5 similarity index 100% rename from test-data/visual-tests/features/special-notes/tied-notes.gp5 rename to test-data/visual-tests/special-notes/tied-notes.gp5 diff --git a/test-data/visual-tests/features/special-notes/tied-notes.png b/test-data/visual-tests/special-notes/tied-notes.png similarity index 100% rename from test-data/visual-tests/features/special-notes/tied-notes.png rename to test-data/visual-tests/special-notes/tied-notes.png diff --git a/test-data/visual-tests/features/special-tracks/drum-tabs.gp b/test-data/visual-tests/special-tracks/drum-tabs.gp similarity index 100% rename from test-data/visual-tests/features/special-tracks/drum-tabs.gp rename to test-data/visual-tests/special-tracks/drum-tabs.gp diff --git a/test-data/visual-tests/features/special-tracks/drum-tabs.png b/test-data/visual-tests/special-tracks/drum-tabs.png similarity index 100% rename from test-data/visual-tests/features/special-tracks/drum-tabs.png rename to test-data/visual-tests/special-tracks/drum-tabs.png diff --git a/test-data/visual-tests/features/special-tracks/grand-staff.gpx b/test-data/visual-tests/special-tracks/grand-staff.gpx similarity index 100% rename from test-data/visual-tests/features/special-tracks/grand-staff.gpx rename to test-data/visual-tests/special-tracks/grand-staff.gpx diff --git a/test-data/visual-tests/features/special-tracks/grand-staff.png b/test-data/visual-tests/special-tracks/grand-staff.png similarity index 100% rename from test-data/visual-tests/features/special-tracks/grand-staff.png rename to test-data/visual-tests/special-tracks/grand-staff.png diff --git a/test-data/visual-tests/features/special-tracks/percussion.gp b/test-data/visual-tests/special-tracks/percussion.gp similarity index 100% rename from test-data/visual-tests/features/special-tracks/percussion.gp rename to test-data/visual-tests/special-tracks/percussion.gp diff --git a/test-data/visual-tests/features/special-tracks/percussion.png b/test-data/visual-tests/special-tracks/percussion.png similarity index 100% rename from test-data/visual-tests/features/special-tracks/percussion.png rename to test-data/visual-tests/special-tracks/percussion.png diff --git a/test/visualTests/VisualTestHelper.ts b/test/visualTests/VisualTestHelper.ts index bff8c65d3..1314a5f5c 100644 --- a/test/visualTests/VisualTestHelper.ts +++ b/test/visualTests/VisualTestHelper.ts @@ -73,7 +73,13 @@ export class VisualTestHelper { settings.core.engine = 'html5'; settings.core.enableLazyLoading = false; - const referenceFileData = await TestPlatform.loadFile(`test-data/visual-tests/${referenceFileName}`); + let referenceFileData: Uint8Array; + try { + referenceFileData = await TestPlatform.loadFile(`test-data/visual-tests/${referenceFileName}`); + } + catch (e) { + referenceFileData = new Uint8Array(0); + } const renderElement = document.createElement('div'); renderElement.style.width = '1300px'; @@ -153,22 +159,31 @@ export class VisualTestHelper { className: string ): Promise { return new Promise((resolve, reject) => { - const img = new Image(); - img.src = 'data:image/png;base64,' + btoa(data.reduce((p, d) => p + String.fromCharCode(d), '')); - img.onload = function () { + if (data.length === 0) { const canvas = document.createElement('canvas'); canvas.classList.add(className); - canvas.width = img.naturalWidth; - canvas.height = img.naturalHeight; + canvas.width = 1; + canvas.height = 1; canvas.dataset.filename = filename.split('/').slice(-1)[0]; - const context = canvas.getContext('2d')!; - context.drawImage(img, 0, 0); - resolve(canvas); - }; - img.onerror = function (e) { - reject(e); - }; + } else { + const img = new Image(); + img.src = 'data:image/png;base64,' + btoa(data.reduce((p, d) => p + String.fromCharCode(d), '')); + img.onload = function () { + const canvas = document.createElement('canvas'); + canvas.classList.add(className); + canvas.width = img.naturalWidth; + canvas.height = img.naturalHeight; + canvas.dataset.filename = filename.split('/').slice(-1)[0]; + const context = canvas.getContext('2d')!; + context.drawImage(img, 0, 0); + + resolve(canvas); + }; + img.onerror = function (e) { + reject(e); + }; + } }); } @@ -316,7 +331,7 @@ export class VisualTestHelper { if (!result.pass) { let percentDifferenceText = percentDifference.toFixed(2); result.message = `Difference between original and new image is too big: ${match.differentPixels}/${totalPixels} (${percentDifferenceText}%)`; - await VisualTestHelper.saveFiles(expectedFileName, expected, actual, diff); + await VisualTestHelper.saveFiles(expectedFileName, expected, oldActual, diff); } else if (sizeMismatch) { result.message = `Image sizes do not match: ${expected.width}/${expected.height} vs ${oldActual.width}/${oldActual.height}`; result.pass = false; @@ -427,13 +442,13 @@ export class VisualTestHelper { diffToggleLabel.style.position = "absolute"; diffToggleLabel.style.left = "0"; diffToggleLabel.style.bottom = "0"; - + const diffToggle = document.createElement('input'); diffToggle.type = 'checkbox'; diffToggleLabel.appendChild(diffToggle); diffToggleLabel.appendChild(document.createTextNode('Show Diff')); - diffToggle.onchange = ()=> { - if(diffToggle.checked) { + diffToggle.onchange = () => { + if (diffToggle.checked) { df.style.display = 'block'; } else { df.style.display = 'none'; @@ -464,7 +479,7 @@ export class VisualTestHelper { const data = new FormData(); data.append('name', name); data.append('expected', expectedData, VisualTestHelper.createFileName(name, 'expected')); - data.append('actual', actualData, VisualTestHelper.createFileName(name, 'actual')); + data.append('actual', actualData, VisualTestHelper.createFileName(name, '')); data.append('diff', diffData, VisualTestHelper.createFileName(name, 'diff')); x.send(data); }); @@ -489,11 +504,15 @@ export class VisualTestHelper { oldName = oldName.substr(i + 1); } + if(part.length > 0) { + part = `-${part}`; + } + i = oldName.lastIndexOf('.'); if (i >= 0) { - oldName = oldName.substr(0, i) + '-' + part + oldName.substr(i); + oldName = oldName.substr(0, i) + part + oldName.substr(i); } else { - oldName += '-' + part; + oldName += part; } return oldName; } diff --git a/test/visualTests/features/EffectsAndAnnotations.test.ts b/test/visualTests/features/EffectsAndAnnotations.test.ts index 50a246f6f..e556db3ac 100644 --- a/test/visualTests/features/EffectsAndAnnotations.test.ts +++ b/test/visualTests/features/EffectsAndAnnotations.test.ts @@ -2,86 +2,86 @@ import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; describe('EffectsAndAnnotationsTests', () => { it('markers', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/markers.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/markers.gp5'); }); it('tempo', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tempo.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/tempo.gp5'); }); it('text', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/text.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/text.gp5'); }); it('chords', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/chords.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/chords.gp5'); }); it('vibrato', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/vibrato.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/vibrato.gp5'); }); it('dynamics', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/dynamics.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/dynamics.gp5'); }); it('tap', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tap.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/tap.gp5'); }); it('fade-in', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/fade-in.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/fade-in.gp5'); }); it('let-ring', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/let-ring.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/let-ring.gp5'); }); it('palm-mute', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/palm-mute.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/palm-mute.gp5'); }); it('bends', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/bends.gp'); + await VisualTestHelper.runVisualTest('effects-and-annotations/bends.gp'); }); it('tremolo-bar', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tremolo-bar.gp'); + await VisualTestHelper.runVisualTest('effects-and-annotations/tremolo-bar.gp'); }); it('tremolo-picking', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tremolo-picking.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/tremolo-picking.gp5'); }); it('brush', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/brush.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/brush.gp5'); }); it('slides', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/slides.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/slides.gp5'); }); it('trill', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/trill.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/trill.gp5'); }); it('pickStroke', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/pick-stroke.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/pick-stroke.gp5'); }); it('tuplets', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tuplets.gp5'); + await VisualTestHelper.runVisualTest('effects-and-annotations/tuplets.gp5'); }); it('tuplets-advanced', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/tuplets-advanced.gp', undefined, [0,1,2]); + await VisualTestHelper.runVisualTest('effects-and-annotations/tuplets-advanced.gp', undefined, [0,1,2]); }); it('fingering', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/fingering.gpx'); + await VisualTestHelper.runVisualTest('effects-and-annotations/fingering.gpx'); }); it('triplet-feel', async () => { - await VisualTestHelper.runVisualTest('features/effects-and-annotations/triplet-feel.gpx'); + await VisualTestHelper.runVisualTest('effects-and-annotations/triplet-feel.gpx'); }); }); diff --git a/test/visualTests/features/General.test.ts b/test/visualTests/features/General.test.ts index dce115dac..3826240b3 100644 --- a/test/visualTests/features/General.test.ts +++ b/test/visualTests/features/General.test.ts @@ -1,48 +1,25 @@ -import { StaveProfile, LayoutMode } from '@src/DisplaySettings'; +import { StaveProfile } from '@src/DisplaySettings'; import { Settings } from '@src/Settings'; import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; -import { TestPlatform } from '@test/TestPlatform'; -import { ScoreLoader } from '@src/importer/ScoreLoader'; -import { Score } from '@src/model/Score'; describe('GeneralTests', () => { it('song-details', async () => { - await VisualTestHelper.runVisualTest('features/general/song-details.gp5'); + await VisualTestHelper.runVisualTest('general/song-details.gp5'); }); it('repeats', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/general/repeats.gp5', settings); + await VisualTestHelper.runVisualTest('general/repeats.gp5', settings); }); it('alternate-endings', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/general/alternate-endings.gp5', settings); + await VisualTestHelper.runVisualTest('general/alternate-endings.gp5', settings); }); it('tuning', async () => { - await VisualTestHelper.runVisualTest('features/general/tuning.gp5'); - }); - - it('notation-legend-default', async () => { - let settings: Settings = new Settings(); - settings.display.layoutMode = LayoutMode.Horizontal; - const inputFileData = await TestPlatform.loadFile(`test-data/visual-tests/features/general/notation-legend.gp`); - const referenceFileName = `features/general/notation-legend-default.png`; - let score: Score = ScoreLoader.loadScoreFromBytes(inputFileData, settings); - - await VisualTestHelper.runVisualTestScore(score, referenceFileName, settings, [0]); - }); - - it('notation-legend-songbook', async () => { - let settings: Settings = new Settings(); - settings.display.layoutMode = LayoutMode.Horizontal; - settings.setSongBookModeSettings(); - const inputFileData = await TestPlatform.loadFile(`test-data/visual-tests/features/general/notation-legend.gp`); - const referenceFileName = `features/general/notation-legend-songbook.png`; - let score: Score = ScoreLoader.loadScoreFromBytes(inputFileData, settings); - await VisualTestHelper.runVisualTestScore(score, referenceFileName, settings, [0]); + await VisualTestHelper.runVisualTest('general/tuning.gp5'); }); }); diff --git a/test/visualTests/features/GuitarTabs.test.ts b/test/visualTests/features/GuitarTabs.test.ts index 450015149..644a0b6d3 100644 --- a/test/visualTests/features/GuitarTabs.test.ts +++ b/test/visualTests/features/GuitarTabs.test.ts @@ -8,20 +8,20 @@ describe('GuitarTabsTests', () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Tab; settings.notation.rhythmMode = TabRhythmMode.ShowWithBars; - await VisualTestHelper.runVisualTest('features/guitar-tabs/rhythm.gp5', settings); + await VisualTestHelper.runVisualTest('guitar-tabs/rhythm.gp5', settings); }); it('rhythm-with-beams', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Tab; settings.notation.rhythmMode = TabRhythmMode.ShowWithBeams; - await VisualTestHelper.runVisualTest('features/guitar-tabs/rhythm-with-beams.gp5', settings); + await VisualTestHelper.runVisualTest('guitar-tabs/rhythm-with-beams.gp5', settings); }); it('string-variations', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Tab; - await VisualTestHelper.runVisualTest('features/guitar-tabs/string-variations.gp5', settings); + await VisualTestHelper.runVisualTest('guitar-tabs/string-variations.gp5', settings); }); }); diff --git a/test/visualTests/features/Layout.test.ts b/test/visualTests/features/Layout.test.ts index 0206fe6d1..307bfc3ca 100644 --- a/test/visualTests/features/Layout.test.ts +++ b/test/visualTests/features/Layout.test.ts @@ -4,22 +4,22 @@ import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; describe('LayoutTests', () => { it('pageLayout', async () => { - await VisualTestHelper.runVisualTest('features/layout/page-layout.gp5'); + await VisualTestHelper.runVisualTest('layout/page-layout.gp5'); }); it('multi-track', async () => { - await VisualTestHelper.runVisualTest('features/layout/multi-track.gp5', undefined, [0, 3]); + await VisualTestHelper.runVisualTest('layout/multi-track.gp5', undefined, [0, 3]); }); it('multi-voice', async () => { - await VisualTestHelper.runVisualTest('features/layout/multi-voice.gp5'); + await VisualTestHelper.runVisualTest('layout/multi-voice.gp5'); }); it('page-layout-5barsperrow', async () => { let settings: Settings = new Settings(); settings.display.layoutMode = LayoutMode.Page; settings.display.barsPerRow = 5; - await VisualTestHelper.runVisualTest('features/layout/page-layout-5barsperrow.gp5', settings); + await VisualTestHelper.runVisualTest('layout/page-layout-5barsperrow.gp5', settings); }); it('page-layout-bar5to8', async () => { @@ -27,13 +27,13 @@ describe('LayoutTests', () => { settings.display.layoutMode = LayoutMode.Page; settings.display.startBar = 5; settings.display.barCount = 4; - await VisualTestHelper.runVisualTest('features/layout/page-layout-5to8.gp5', settings); + await VisualTestHelper.runVisualTest('layout/page-layout-5to8.gp5', settings); }); it('horizontal-layout', async () => { let settings: Settings = new Settings(); settings.display.layoutMode = LayoutMode.Horizontal; - await VisualTestHelper.runVisualTest('features/layout/horizontal-layout.gp5', settings); + await VisualTestHelper.runVisualTest('layout/horizontal-layout.gp5', settings); }); it('horizontal-layout-bar5to8', async () => { @@ -41,6 +41,6 @@ describe('LayoutTests', () => { settings.display.layoutMode = LayoutMode.Horizontal; settings.display.startBar = 5; settings.display.barCount = 4; - await VisualTestHelper.runVisualTest('features/layout/horizontal-layout-5to8.gp5', settings); + await VisualTestHelper.runVisualTest('layout/horizontal-layout-5to8.gp5', settings); }); }); diff --git a/test/visualTests/features/MusicNotation.test.ts b/test/visualTests/features/MusicNotation.test.ts index 74133857b..02a02ce12 100644 --- a/test/visualTests/features/MusicNotation.test.ts +++ b/test/visualTests/features/MusicNotation.test.ts @@ -16,36 +16,36 @@ describe('MusicNotationTests', () => { settings.notation.elements.set(NotationElement.ScoreTitle, false); settings.notation.elements.set(NotationElement.ScoreWords, false); settings.notation.elements.set(NotationElement.ScoreWordsAndMusic, false); - await VisualTestHelper.runVisualTest('features/music-notation/clefs.gpx', settings); + await VisualTestHelper.runVisualTest('music-notation/clefs.gpx', settings); }); it('key-signatures', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/music-notation/key-signatures.gp', settings); + await VisualTestHelper.runVisualTest('music-notation/key-signatures.gp', settings); }); it('time-signatures', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/music-notation/time-signatures.gp5', settings); + await VisualTestHelper.runVisualTest('music-notation/time-signatures.gp5', settings); }); it('notes-rests-beams', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/music-notation/notes-rests-beams.gp5', settings); + await VisualTestHelper.runVisualTest('music-notation/notes-rests-beams.gp5', settings); }); it('accidentals', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/music-notation/accidentals.gp5', settings); + await VisualTestHelper.runVisualTest('music-notation/accidentals.gp5', settings); }); it('forced-accidentals', async () => { let settings: Settings = new Settings(); settings.display.staveProfile = StaveProfile.Score; - await VisualTestHelper.runVisualTest('features/music-notation/forced-accidentals.gp', settings, [0, 1]); + await VisualTestHelper.runVisualTest('music-notation/forced-accidentals.gp', settings, [0, 1]); }); }); diff --git a/test/visualTests/features/NotationElements.test.ts b/test/visualTests/features/NotationElements.test.ts index fe97fe1c1..a4fe63b75 100644 --- a/test/visualTests/features/NotationElements.test.ts +++ b/test/visualTests/features/NotationElements.test.ts @@ -43,7 +43,7 @@ describe('NotationElements', () => { const referenceName = testCases.get(element)!; await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/score-info-${referenceName}.png`, + `notation-elements/score-info-${referenceName}.png`, settings, undefined, referenceName @@ -56,7 +56,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.ScoreWordsAndMusic, true); await VisualTestHelper.runVisualTestTex( `\\album "Album" \\artist "Artist" \\copyright "Copyright" \\music "WordsAndMusic" \\subtitle "Subtitle" \\title "Title" \\words "WordsAndMusic" . 3.3*4`, - `features/notation-elements/score-info-words-and-music.png`, + `notation-elements/score-info-words-and-music.png`, settings, undefined, 'words-and-music' @@ -66,7 +66,7 @@ describe('NotationElements', () => { settings.notation.elements.clear(); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/score-info-all.png`, + `notation-elements/score-info-all.png`, settings, undefined, 'all' @@ -80,7 +80,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.GuitarTuning, true); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/guitar-tuning-on.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/guitar-tuning-on.png`, settings); }); it('guitar-tuning-off', async () => { @@ -90,7 +90,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.GuitarTuning, false); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/guitar-tuning-off.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/guitar-tuning-off.png`, settings); }); it('track-names-off', async () => { @@ -100,7 +100,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.TrackNames, false); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/track-names-off.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/track-names-off.png`, settings); }); it('track-names-on', async () => { @@ -110,7 +110,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.TrackNames, true); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/track-names-on.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/track-names-on.png`, settings); }); it('chord-diagrams-off', async () => { @@ -120,7 +120,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.ChordDiagrams, false); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/chord-diagrams-off.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/chord-diagrams-off.png`, settings); }); it('chord-diagrams-on', async () => { @@ -130,7 +130,7 @@ describe('NotationElements', () => { settings.display.layoutMode = LayoutMode.Page; settings.notation.elements.set(NotationElement.ChordDiagrams, true); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/chord-diagrams-on.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/chord-diagrams-on.png`, settings); }); it('parenthesis-on-tied-bends-off', async () => { @@ -142,7 +142,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.ParenthesisOnTiedBends, false); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/parenthesis-on-tied-bends-off.png`, + `notation-elements/parenthesis-on-tied-bends-off.png`, settings ); }); @@ -156,7 +156,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.ParenthesisOnTiedBends, true); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/parenthesis-on-tied-bends-on.png`, + `notation-elements/parenthesis-on-tied-bends-on.png`, settings ); }); @@ -170,7 +170,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.TabNotesOnTiedBends, false); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/tab-notes-on-tied-bends-off.png`, + `notation-elements/tab-notes-on-tied-bends-off.png`, settings ); }); @@ -184,7 +184,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.TabNotesOnTiedBends, true); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/tab-notes-on-tied-bends-on.png`, + `notation-elements/tab-notes-on-tied-bends-on.png`, settings ); }); @@ -198,7 +198,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.ZerosOnDiveWhammys, false); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/zeros-on-dive-whammys-off.png`, + `notation-elements/zeros-on-dive-whammys-off.png`, settings ); }); @@ -212,7 +212,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.ZerosOnDiveWhammys, true); await VisualTestHelper.runVisualTestTex( tex, - `features/notation-elements/zeros-on-dive-whammys-on.png`, + `notation-elements/zeros-on-dive-whammys-on.png`, settings ); }); @@ -225,7 +225,7 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.EffectTempo, false); settings.notation.elements.set(NotationElement.EffectTripletFeel, false); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/effects-off.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/effects-off.png`, settings); }); it('effects-on', async () => { @@ -236,6 +236,6 @@ describe('NotationElements', () => { settings.notation.elements.set(NotationElement.EffectTempo, true); settings.notation.elements.set(NotationElement.EffectTripletFeel, true); - await VisualTestHelper.runVisualTestTex(tex, `features/notation-elements/effects-on.png`, settings); + await VisualTestHelper.runVisualTestTex(tex, `notation-elements/effects-on.png`, settings); }); }); diff --git a/test/visualTests/features/NotationLegend.test.ts b/test/visualTests/features/NotationLegend.test.ts new file mode 100644 index 000000000..0ae1cedec --- /dev/null +++ b/test/visualTests/features/NotationLegend.test.ts @@ -0,0 +1,111 @@ +import { LayoutMode } from '@src/DisplaySettings'; +import { Settings } from '@src/Settings'; +import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; +import { TestPlatform } from '@test/TestPlatform'; +import { ScoreLoader } from '@src/importer/ScoreLoader'; +import { Score } from '@src/model/Score'; + +describe('NotationLegend', () => { + it('full-default', async () => { await runNotationLegendTest(`full-default.png`, 1, -1, false); }); + it('full-songbook', async () => { await runNotationLegendTest(`full-songbook.png`, 1, -1, true); }); + + it('bends-default', async () => { await runNotationLegendTest(`bends-default.png`, 1, 29, false); }); + it('bends-songbook', async () => { await runNotationLegendTest(`bends-songbook.png`, 1, 29, true); }); + + it('grace-default', async () => { await runNotationLegendTest(`grace-default.png`, 30, 2, false); }); + it('grace-songbook', async () => { await runNotationLegendTest(`grace-songbook.png`, 30, 2, true); }); + + it('vibrato-default', async () => { await runNotationLegendTest(`vibrato-default.png`, 32, 4, false); }); + it('vibrato-songbook', async () => { await runNotationLegendTest(`vibrato-songbook.png`, 32, 4, true); }); + + it('multi-grace-default', async () => { await runNotationLegendTest(`multi-grace-default.png`, 36, 4, false); }); + it('multi-grace-songbook', async () => { await runNotationLegendTest(`multi-grace-songbook.png`, 36, 4, true); }); + + it('pick-stroke-default', async () => { await runNotationLegendTest(`pick-stroke-default.png`, 40, 1, false); }); + it('pick-stroke-songbook', async () => { await runNotationLegendTest(`pick-stroke-songbook.png`, 40, 1, true); }); + + it('slides-default', async () => { await runNotationLegendTest(`slides-default.png`, 41, 8, false); }); + it('slides-songbook', async () => { await runNotationLegendTest(`slides-songbook.png`, 41, 8, true); }); + + it('hammer-default', async () => { await runNotationLegendTest(`hammer-default.png`, 49, 5, false); }); + it('hammer-songbook', async () => { await runNotationLegendTest(`hammer-songbook.png`, 49, 5, true); }); + + it('accentuations-default', async () => { await runNotationLegendTest(`accentuations-default.png`, 54, 4, false); }); + it('accentuations-songbook', async () => { await runNotationLegendTest(`accentuations-songbook.png`, 44, 4, true); }); + + it('trill-default', async () => { await runNotationLegendTest(`trill-default.png`, 58, 2, false); }); + it('trill-songbook', async () => { await runNotationLegendTest(`trill-songbook.png`, 58, 2, true); }); + + it('dead-default', async () => { await runNotationLegendTest(`dead-default.png`, 60, 2, false); }); + it('dead-songbook', async () => { await runNotationLegendTest(`dead-songbook.png`, 60, 2, true); }); + + it('harmonics-default', async () => { await runNotationLegendTest(`harmonics-default.png`, 62, 7, false); }); + it('harmonics-songbook', async () => { await runNotationLegendTest(`harmonics-songbook.png`, 62, 7, true); }); + + it('repeat-bar-default', async () => { await runNotationLegendTest(`tap-riff-default.png`, 69, 4, false); }); + it('repeat-bar-songbook', async () => { await runNotationLegendTest(`tap-riff-songbook.png`, 69, 4, true); }); + + it('multi-voice-default', async () => { await runNotationLegendTest(`multi-voice-default.png`, 73, 1, false); }); + it('multi-voice-songbook', async () => { await runNotationLegendTest(`multi-voice-songbook.png`, 73, 1, true); }); + + it('arpeggio-default', async () => { await runNotationLegendTest(`arpeggio-default.png`, 74, 2, false); }); + it('arpeggio-songbook', async () => { await runNotationLegendTest(`arpeggio-songbook.png`, 74, 2, true); }); + + it('triplet-feel-default', async () => { await runNotationLegendTest(`triplet-feel-default.png`, 76, 3, false); }); + it('triplet-feel-songbook', async () => { await runNotationLegendTest(`triplet-feel-songbook.png`, 76, 3, true); }); + + it('ottavia-default', async () => { await runNotationLegendTest(`ottavia-default.png`, 79, 2, false); }); + it('ottavia-songbook', async () => { await runNotationLegendTest(`ottavia-songbook.png`, 79, 2, true); }); + + it('crescendo-default', async () => { await runNotationLegendTest(`crescendo-default.png`, 81, 1, false); }); + it('crescendo-songbook', async () => { await runNotationLegendTest(`crescendo-songbook.png`, 81, 1, true); }); + + it('tempo-change-default', async () => { await runNotationLegendTest(`tempo-change-default.png`, 81, 5, false); }); + it('tempo-change-songbook', async () => { await runNotationLegendTest(`tempo-change-songbook.png`, 81, 5, true); }); + + it('slash-default', async () => { await runNotationLegendTest(`slash-default.png`, 86, 1, false); }); + it('slash-songbook', async () => { await runNotationLegendTest(`slash-songbook.png`, 86, 1, true); }); + + it('text-default', async () => { await runNotationLegendTest(`text-default.png`, 87, 1, false); }); + it('text-songbook', async () => { await runNotationLegendTest(`text-songbook.png`, 87, 1, true); }); + + it('chords-default', async () => { await runNotationLegendTest(`chords-default.png`, 88, 2, false); }); + it('chords-songbook', async () => { await runNotationLegendTest(`chords-songbook.png`, 88, 2, true); }); + + it('staccatissimo-default', async () => { await runNotationLegendTest(`staccatissimo-default.png`, 90, 1, false); }); + it('staccatissimo-songbook', async () => { await runNotationLegendTest(`staccatissimo-songbook.png`, 90, 1, true); }); + + it('wah-default', async () => { await runNotationLegendTest(`wah-default.png`, 91, 1, false); }); + it('wah-songbook', async () => { await runNotationLegendTest(`wah-songbook.png`, 91, 1, true); }); + + it('dynamics-default', async () => { await runNotationLegendTest(`dynamics-default.png`, 92, 1, false); }); + it('dynamics-songbook', async () => { await runNotationLegendTest(`dynamics-songbook.png`, 92, 1, true); }); + + it('sweep-default', async () => { await runNotationLegendTest(`sweep-default.png`, 93, 1, false); }); + it('sweep-songbook', async () => { await runNotationLegendTest(`sweep-songbook.png`, 92, 1, true); }); + + it('fingering-default', async () => { await runNotationLegendTest(`fingering-default.png`, 94, 2, false); }); + it('fingering-songbook', async () => { await runNotationLegendTest(`fingering-songbook.png`, 94, 2, true); }); + + it('whammy-default', async () => { await runNotationLegendTest(`whammy-default.png`, 96, 15, false); }); + it('whammy-songbook', async () => { await runNotationLegendTest(`whammy-songbook.png`, 96, 15, true); }); + + it('let-ring-default', async () => { await runNotationLegendTest(`let-ring-default.png`, 111, 10, false); }); + it('let-ring-songbook', async () => { await runNotationLegendTest(`let-ring-songbook.png`, 111, 10, true); }); + + it('mixed-default', async () => { await runNotationLegendTest(`mixed-default.png`, 121, 7, false); }); + it('mixed-songbook', async () => { await runNotationLegendTest(`mixed-songbook.png`, 121, 7, true); }); + + async function runNotationLegendTest(referenceFileName: string, startBar: number, barCount: number, songBook: boolean): Promise { + let settings: Settings = new Settings(); + settings.display.layoutMode = LayoutMode.Horizontal; + settings.display.startBar = startBar; + settings.display.barCount = barCount; + if (songBook) { + settings.setSongBookModeSettings(); + } + const inputFileData = await TestPlatform.loadFile(`test-data/visual-tests/notation-legend/notation-legend.gp`); + let score: Score = ScoreLoader.loadScoreFromBytes(inputFileData, settings); + await VisualTestHelper.runVisualTestScore(score, `notation-legend/${referenceFileName}`, settings, [0]); + } +}); diff --git a/test/visualTests/features/SpecialNotes.test.ts b/test/visualTests/features/SpecialNotes.test.ts index e40184f27..4bbb1d5a3 100644 --- a/test/visualTests/features/SpecialNotes.test.ts +++ b/test/visualTests/features/SpecialNotes.test.ts @@ -2,22 +2,22 @@ import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; describe('SpecialNotesTests', () => { it('tied-notes', async () => { - await VisualTestHelper.runVisualTest('features/special-notes/tied-notes.gp5'); + await VisualTestHelper.runVisualTest('special-notes/tied-notes.gp5'); }); it('grace-notes', async () => { - await VisualTestHelper.runVisualTest('features/special-notes/grace-notes.gp5'); + await VisualTestHelper.runVisualTest('special-notes/grace-notes.gp5'); }); it('grace-notes-advanced', async () => { - await VisualTestHelper.runVisualTest('features/special-notes/grace-notes-advanced.gp', undefined, [0, 1]); + await VisualTestHelper.runVisualTest('special-notes/grace-notes-advanced.gp', undefined, [0, 1]); }); it('dead-notes', async () => { - await VisualTestHelper.runVisualTest('features/special-notes/dead-notes.gp5'); + await VisualTestHelper.runVisualTest('special-notes/dead-notes.gp5'); }); it('ghost-notes', async () => { - await VisualTestHelper.runVisualTest('features/special-notes/ghost-notes.gp5'); + await VisualTestHelper.runVisualTest('special-notes/ghost-notes.gp5'); }); }); diff --git a/test/visualTests/features/SpecialTracks.test.ts b/test/visualTests/features/SpecialTracks.test.ts index 0bf9b7ef7..a3ea0659e 100644 --- a/test/visualTests/features/SpecialTracks.test.ts +++ b/test/visualTests/features/SpecialTracks.test.ts @@ -2,14 +2,14 @@ import { VisualTestHelper } from '@test/visualTests/VisualTestHelper'; describe('SpecialTracksTests', () => { it('drum-tabs', async () => { - await VisualTestHelper.runVisualTest('features/special-tracks/drum-tabs.gp'); + await VisualTestHelper.runVisualTest('special-tracks/drum-tabs.gp'); }); it('percussion', async () => { - await VisualTestHelper.runVisualTest('features/special-tracks/percussion.gp', undefined, [0, 1, 2]); + await VisualTestHelper.runVisualTest('special-tracks/percussion.gp', undefined, [0, 1, 2]); }); it('grand-staff', async () => { - await VisualTestHelper.runVisualTest('features/special-tracks/grand-staff.gpx'); + await VisualTestHelper.runVisualTest('special-tracks/grand-staff.gpx'); }); });