A bushfire that ravaged an area northeast of Perth for more than a week was successfully contained with help from long-awaited rain.