I might be wrong, but I believe you're setting a different type of "background" that's z-fighting with the template's own backgrounds. Try using the global designations of the title and dialog body directly instead of the whole frame.
Here's the whole template from SharedXML\SharedBasicControls.xml:
XML Code:
<Frame name="UIPanelDialogTemplate" virtual="true">
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentTopLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.501953125" right="0.625" top="0" bottom="1"/>
</Texture>
<Texture name="$parentTopRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.625" right="0.75" top="0" bottom="1"/>
</Texture>
<Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="0" y="64"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="TOPRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.25" right="0.369140625" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.751953125" right="0.875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.875" right="1" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="0" y="64"/>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.376953125" right="0.498046875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.001953125" right="0.125" top="0" bottom="1"/>
</Texture>
<Texture name="$parentRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
<Size x="64" y="0"/>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="BOTTOMRIGHT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.1171875" right="0.2421875" top="0" bottom="1"/>
</Texture>
<FontString parentKey="Title" inherits="GameFontNormal">
<Anchors>
<Anchor point="TOPLEFT" x="12" y="-8"/>
<Anchor point="TOPRIGHT" x="-32" y="-8"/>
</Anchors>
</FontString>
</Layer>
<Layer level="BACKGROUND">
<Texture name="$parentTitleBG" file="Interface\PaperDollInfoFrame\UI-GearManager-Title-Background">
<Anchors>
<Anchor point="TOPLEFT" x="8" y="-7"/>
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="-8" y="-24"/>
</Anchors>
</Texture>
<Texture name="$parentDialogBG" file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-L1">
<Anchors>
<Anchor point="TOPLEFT" x="8" y="-24"/>
<Anchor point="BOTTOMRIGHT" x="-6" y="8"/>
</Anchors>
<TexCoords left="0.255" right="1" top="0.29" bottom="1"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="$parentClose" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT" x="2" y="1"/>
</Anchors>
</Button>
</Frames>
</Frame>
For your frame, the title background object is
TestPopupTitleBG and the body is
TestPopupDialogBG.