I think you are wondering about DNA.
Amniocentesis typically wouldn't include the kind of DNA testing that's done for genealogy. Amniocentesis is done to look at the fetus' chromosomes -- looking for abnormalities like an third copy of one chromosome -- and if there's concern about a genetic disease they might test for the gene(s) for that disease. That's very different from the DNA tests for genealogy purposes.
Also, amniocentesis testing looks only at the chromosomes of the fetus. I think the parents might also be tested if there is suspicion of an inherited chromosome defect, but if they did that, they'd collect samples from each parent.